Bash script using JSON-RPC via curl suddenly not working anymore!
#1
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!

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
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!
Reply
#2
EDIT: Never mind... I'm a moron... had altered the Kodi port from 8080 to something else and forgot about it...

I see no possibility to delete a post or thread??
Reply

Logout Mark Read Team Forum Stats Members Help
Bash script using JSON-RPC via curl suddenly not working anymore!0