user=osmc password=osmc host=osmc port=80 case $1 in vs|VideoScan) ping -c 1 $host >/dev/null 2>&1 if [ $? == 0 ] then curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;' http://$user:$password@$host:$port/jsonrpc else echo $host " ist down" fi echo curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;' http://kodi:kodi@coreelec:8080/jsonrpc ;; as|AudioScan) curl --data-binary '{ "jsonrpc": "2.0", "method": "AudioLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;' http://$user:$password@$host:$port/jsonrpc ;; vc|VideoClean) curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Clean", "id": "mybash"}' -H 'content-type: application/json;' http://$user:$password@$host:$port/jsonrpc ;; ac|AudioClean) curl --data-binary '{ "jsonrpc": "2.0", "method": "AudioLibrary.Clean", "id": "mybash"}' -H 'content-type: application/json;' http://$user:$password@$host:$port/jsonrpc ;; rb|Reboot) curl --data-binary '{ "jsonrpc": "2.0", "method": "System.Reboot", "id": "mybash"}' -H 'content-type: application/json;' http://$user:$password@$host:$port/jsonrpc ;; *) echo $0 VideoScan echo $0 AudioScan echo $0 VideoClean echo $0 AudioClean exit 1 esac #curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;' http://osmc:osmc@osmc:80/jsonrpc echo