kolossos4730 wrote: 
> Greg,
> 
> I know it's a niche market but in my case specific to piCorePlayer as
> there is no support for unmuting the pi-AMP (yet?). Maybe others could
> benefit from this script.
> 
> > 
Code:
--------------------
  >   >         RESULT=`( echo "$PI_MAC_ADDRESS $COMMAND"; echo exit ) | nc 
$LMS_IP_ADDRESS $LMS_CLI_PORT_NUMBER`
  >     echo $RESULT | grep "mode%3Aplay" > /dev/null 2>&1
  >     if [ $? == 0 ]; then
--------------------
> > 
> 
> If I understand correctly the first line uses nc to send a LMS CLI
> command to the LMS server. The second line in combination with the
> grep command searches for the "mode%3Aplay" string. The third line
> evaluates the exit code of this search. If the exit code equals 0 ($?
> == 0) then the search string was found and Squeezelite is in a playing
> state. Any other exit code results in a stopped state.
> 
> I check the value of GPIO 22 as I thought it would be better to only
> set/unset GPIO 22 if the previous state was different from the desired
> state.

Hi Arie,

We would probably add the script if we had a pi-amp to test. Steen may
already have one, I am not sure.

It sounds like you have a good understand of the code, not bad for your
first script.

regards
Greg


------------------------------------------------------------------------
Greg Erskine's Profile: http://forums.slimdevices.com/member.php?userid=7403
View this thread: http://forums.slimdevices.com/showthread.php?t=97803

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to