11.08.2020, 12:37
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)