06.04.2021, 07:31
(31.03.2021, 08:19)Daniel. Wrote: Not sure if this is correct approach but you could try ping google.com. Use this script, you will get 0 on success.
Code:ip = 'google.com'
res = os.execute('ping -c 2 -W 1 ' .. ip)
log(res)
Thanks! So I did this:
Code:
ip = '192.168.0.1'
res = os.execute('ping -c 2 -W 1 ' .. ip)
if (res == 1) then
log("Reboot due to VPN down")
grp.write('4/1/2', false)
os.sleep(1.5)
grp.write('4/1/2', true)
end