11.08.2020, 13:12
(11.08.2020, 12:37)admin Wrote: Thank you Erwin this solves the problem. Looks like I have to do some more reading up on LUA.
Thanks!!
Try this:
Code:if not ping then function ping(ip) local res = os.execute('ping -c 2 -W 5 ' .. ip) return res == 0 end failcount = 0 end res = ping('google.com') if res then log('INTERNET connected') failcount = 0 else log('INTERNET disconnected') failcount = failcount + 1 end log(failcount)