2020-09-11, 06:49
Hello,
a Bash script on my Linux NUC which worked for years (!) doesn't work anymore and I can't find what has changed to Kodi or something else!
The variable "status" (which is there to see whether Kodi is now playing a video or not) is now always empty, no matter what!
Either the JSON-RPC URL is now wrong or the curl command doesn't work anymore in this form...
What can I do? What must be changed?
Thanks in advance!
a Bash script on my Linux NUC which worked for years (!) doesn't work anymore and I can't find what has changed to Kodi or something else!
Code:
#!/bin/bash
jsonURL="http://kodi:[email protected]:8080/jsonrpc"
status=`curl -H Content-Type:application/json -d '{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}' -s $jsonURL -m 1`
ID=`echo $status | jq '.["result"]' | jq '.[0]["playerid"]'`
if [ "$status" == "null" ] || [ "$status" == 0 ]; then
echo "No active players"
else
echo $status
fi
Either the JSON-RPC URL is now wrong or the curl command doesn't work anymore in this form...
What can I do? What must be changed?
Thanks in advance!