Thanks whale-av using a timer solved my problem. If someone needs it, below is the code for a 10 seconds non blocking delay:
local tmr = require("timer"); actions.test= function () os.script("./script1.sh"); tid = tmr.timeout(function() os.script("/script2.sh"); end, 10000); end
I am running Unified Remote Server on a Raspberry Pi and want to programm a non blocking delay. So far I have tried different implementations, however the main problem is that during the delay (sleep phase) URServer is not ready to take other commands. One implementation is:
actions.test= function () os.script("./script1.sh"); os.sleep(60000); os.script("./script2.sh"); end
I have already tried executing the sleep in the scripts using a background worker without success. Input how to implement a non blocking delay is therefore highly appreciated.