Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :local piholedown [/ip firewall nat get ([find where comment="PiHole-DNS"]->0) disabled]
- :local piholeDNS "10.0.0.1"
- :local testDomain "www.google.com"
- :local token "XXXXXXXXXXXXXXXXXX"
- :local chatid "YYYYYYY"
- :if ($piholedown = false) do={
- :do {
- :resolve domain-name="$testDomain" server="$piholeDNS"
- } on-error={
- /ip firewall nat
- disable [find comment="PiHole-DNS"]
- enable [find comment="Google-DNS"]
- :delay 2000ms
- /tool fetch "https://api.telegram.org/bot$token/sendmessage\?chat_id=$chatid&text=Pi-Hole not working! Changed DNS to GoogleDNS." keep-result=no
- }
- } else={
- :do {
- :resolve domain-name="$testDomain" server="$piholeDNS"
- /ip firewall nat
- enable [find comment="PiHole-DNS"]
- disable [find comment="Google-DNS"]
- :delay 2000ms
- /tool fetch "https://api.telegram.org/bot$token/sendmessage\?chat_id=$chatid&text=Pi-Hole working! Changed DNS." keep-result=no
- } on-error={}
- }
Add Comment
Please, Sign In to add comment