2011-11-11, 04:50
i now made a shell-script, i had no desire to write a php-script...
this works for me:
i wrote another script that calls this script, sleeps 10 seconds and than calls the script again, sleeps 10 seconds again... and again, altogether 5 times. and finally this "wrapper"-script is cronjobbed and started every minute.
so my playlist starts again after max 10 seconds blank screen..
this works for me:
PHP Code:
#!/bin/bash
result=`curl -u user:pass --data-binary '{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}' -H 'content-type: text/plain;' http://localhost:8080/jsonrpc`
str_result=${result:(-11):4}
if [[ "$str_result" == "true" ]]
then
echo "nichts zu tun..."
else
curl -u user:pass --data-binary '{"jsonrpc": "2.0", "method": "VideoPlaylist.Play", "id": 1}' -H 'content-type: text/plain;' http://localhost:8080/jsonrpc
echo "-----------------"
echo `date`
echo "-----------------"
echo "Playlist wieder gestartet..."
fi
i wrote another script that calls this script, sleeps 10 seconds and than calls the script again, sleeps 10 seconds again... and again, altogether 5 times. and finally this "wrapper"-script is cronjobbed and started every minute.
so my playlist starts again after max 10 seconds blank screen..