Lua Ping presence script keeps running
Posted: Friday 19 August 2016 12:40
I am using this basic lua ping presence script which works fine except it keeps sending a ping every second. Scripts are normally fired once every minute, so how do I stop this script after one ping? Even beter would be if this script only ran once every 5 or 10 minutes. How do I achieve that?
Code: Select all
commandArray = {}
ping_success=os.execute('ping -c1 192.168.1.101')
if ping_success then
print("macbook is online")
commandArray['testping']='On'
else
print("macbook offline")
commandArray['testping']='Off'
end
return commandArray