Your script works under pcp 3.20.2
I am logged in as user tc.
I copy-pasted the code to a file and changed "#!/bin/sh" to "#!/bin/sh
-x"
Then I did "chmod +x foo.sh" to make it executable, I get this kind of
stuff
Code:
--------------------
    $ ./foo.sh 
  + . /home/tc/www/cgi-bin/pcp-functions
  + DEBUGLOG=/var/log/pcp_debug.log
  + pcp_config_file
  + CONFIGCFG=/usr/local/sbin/config.cfg
  + . /usr/local/sbin/config.cfg
  + WIFI=off
  + SSID=wireless
  + PASSWORD=password
  + ENCRYPTION=WPA
  + DEBUG=0
  + MODE=40
  + TEST=0
  + NAME=Berlin-Boombox
  + OUTPUT=equal
  + ALSA_PARAMS=160:::1:
  + BUFFER_SIZE=
  ...
  + MAC_ADDR=ab:cd:ef:12:34:63
  + LMS_IP=192.168.0.229
  + INTERVAL=0.5
  + GPIO=12
  + COMMAND=status 0 0
  + DELAYOFF=20
  + COUNT=0
  + DEBUG=0
  + TURNED_ON=0
--------------------

If you type "echo $ENV" you can see all the variables pcp-variables has
created for your script to use.
The funny ". /home/tc/www/cgi-bin/pcp-functions" is more legibly written
as "source /home/tc/www/cgi-bin/pcp-functions", that "merges" a script
into another one. This is how your script can call "pcp-variables" right
after that.

BTW, do you need to poll player status via a script? In the GUI under
Squeezelite, bottom of page, there is provision to define a script or
GPIO pins that SL will activate when player status transitions to power
on or to power off.



3 SB 3 • Libratone Loop, Zipp Mini • iPeng (iPhone + iPad) • LMS 7.9
(linux) with plugins: CD Player, WaveInput, Triode's BBC iPlayer by bpa
• IRBlaster by Gwendesign (Felix) • Server Power Control by Gordon
Harris • Smart Mix, Music Walk With Me, What Was That Tune? by Michael
Herger • PowerSave by Jason Holtzapple • Song Info, Song Lyrics by
Erland Isaksson • AirPlay Bridge by philippe_44 • WeatherTime by Martin
Rehfeld • Auto Dim Display, SaverSwitcher, ContextMenu by Peter Watkins.
------------------------------------------------------------------------
epoch1970's Profile: http://forums.slimdevices.com/member.php?userid=16711
View this thread: http://forums.slimdevices.com/showthread.php?t=108354

_______________________________________________
unix mailing list
unix@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to