The last API call in the scipt is to restart the UI. Unfortunately the API call does not return any response. This produces an error when called, CURL_GOT_NOTHING (52) for example with CURL. When I use WGET it's worse, it creates a loop. This loop is tried about 20 times in the standard call of WGET. I can use "wget --tries=1", but the Errorcode (Network failure (4)) comes also. Same for CURL command.
If the API would return an JSON response like "now restarting the UI" and only then does a restart of the UI, the problem would not exist. The API call would end cleanly and no error would be displayed.