I have looked at this further, you have to allow the ip in the remote settings on the phone and the first time it will ask on the screen if it is OK to allow remote control but from then on, something like this works just fine:
curl 'https://username:password@ipaddress/servlet?key=Reboot' -k...