ExecuteAddon notification on finished?

I wrote a simple script to scan the library, clean library, switch profile, scan library, clean library using WebSockets. It works great, but I would like to add a step after cleaning – I want to perform a Trakt sync. I can use something like this :

Code:
curl -v -H "Accept: application/json" -H "Content-type: application/json" -u user:password -d '{"jsonrpc":"2.0","method":"Addons.ExecuteAddon","params":{"addonid":"script.trakt","params":{"action":"sync","silent":"True"}},"id":1}'

However, I’m not sure how I can know when it’s done (in order to switch profile et execute my upcoming commands)… I could wait for like 3-5 minutes but that’s more like a hack than a proper implementation. Any ideas?