Skip to content

Instantly share code, notes, and snippets.

@dz0ny
Created December 22, 2010 14:56
Show Gist options
  • Save dz0ny/751610 to your computer and use it in GitHub Desktop.
Save dz0ny/751610 to your computer and use it in GitHub Desktop.
#!/bin/sh
exec 1>/dev/null
#state detection
PLAYING="`echo status | nc 127.0.0.1 6600 | grep -o 'state: play' -c`"
echo $PLAYING > /proc/diag/led/power
if [ "$PLAYING" = "0" ];then
echo play | nc 127.0.0.1 6600
exit
else
echo stop | nc 127.0.0.1 6600
exit
fi
#state detection
PLAYING="`echo status | nc 127.0.0.1 6600 | grep -o 'state: play' -c`"
echo $PLAYING > /proc/diag/led/power
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment