Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- socket = require "socket"
- http = require "socket.http"
- while true do
- -- request to my own website and another one that should in theory always be online
- response = http.request("http://cc.ordewittetafel.nl/cc")
- response2 = http.request("http://example.com")
- -- if both sites are down, turn networking off, wait 10 seconds and turn it on again
- if not response and not response2 then
- os.execute("nmcli networking off")
- socket.sleep(10)
- os.execute("nmcli networking on")
- end
- socket.sleep(180)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement