2017-10-30, 16:03
(2017-10-30, 15:39)crono141 Wrote: Thanks. If I understand correctly the only portion of that script that I need to quit Kodi is the kodi_rpc function definition, and then the line that calls it with Application.Quit?
Exactly. If you just want to exit Kodi then you need
Code:
kodi_rpc()
{
METHOD="$1"
json_str="{\"jsonrpc\":\"2.0\",\"id\":\"1\",\"method\":\"$METHOD\"}\""
curl -H "Content-type: application/json" -d "$json_str" http://localhost:8080/jsonrpc
}
kodi_rpc "Application.Quit"
Note that you need to have the curl command installed. Curl is a very standard and basic command so I think it is present even in LibreELEC.
If you do not want to use kodi_rpc_notification and kodi_rpc_params then you don't need to include the function definition code in the script. kodi_rpc_notification is nice because if something is wrong the script is able to display a notification in Kodi.