#!/bin/sh

# url to kodi jsonrpc
url=http://kodi:kodi@192.168.10.22:58080/jsonrpc

# https://github.com/trakt/script.trakt/issues/192#issuecomment-70359374
request='{
        "jsonrpc":"2.0",
        "method":"Addons.ExecuteAddon",
        "params":{
                "addonid":"script.trakt",
                "params":{
                        "action":"sync",
                        "silent":"False"
                }
        },
        "id":1
}'

exec curl -sSLf --include --header 'content-type: application/json;' --request POST --data-binary "$request" "$url"