Last active
March 29, 2021 07:45
-
-
Save slipeer/263460ce38ee0c8e895d50d2527a50a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##############Script Settings################## | |
:local henetkey "XXXXXXXXXXXXXXXXXXXX" | |
:local henethost "XXXXXXXX.XX" | |
:local henameserver "ns1.he.net" | |
:local WANInter "wan" | |
############################################### | |
:local IpCurrent [/ip address get [find interface=$WANInter] address]; | |
:for i from=( [:len $IpCurrent] - 1) to=0 do={ | |
:if ( [:pick $IpCurrent $i] = "/") do={ | |
:local NewIP [:pick $IpCurrent 0 $i]; | |
:if ([:resolve $henethost server=$henameserver] != $NewIP) do={ | |
/tool fetch mode=https url="https://dyn.dns.he.net/nic/update\3Fhostname=$henethost&password=$henetkey&myip=$NewIP" | |
:log info "HE DNS Update: $henethost - $NewIP | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment