Simple Bash Script to Detect if Squeezeplayer is Playing or Paused

Here’s a bit of code running on my Raspberry Pi that detects if the current Squeezelite player is playing or is paused.

Replace with the IP address of the server and replace 62:74:01:10:10:40 with your player ID.

Note, you can find your player ID by hitting the “Settings” link and checking the URL. It will look something like this:

if [ ! -z "`curl --data '{"method":"slim.request","params":["62:74:01:10:10:40",["status","-","mode"]]}' 2>/dev/null | grep -i '"mode":"play"'`" ]; then
        echo PLAYING
        echo PAUSED