-
-
Save anviar/6050262539c950999813a0919eba9846 to your computer and use it in GitHub Desktop.
Microtik no-ip update script. Require read and write permissions
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
:local NOIPUser "username" | |
:local NOIPPass "serRetPasswwwwoD" | |
:local NOIPDomain "example.com" | |
:local WANInter [/interface get [ find type=pppoe-out running] name ] | |
:local IpCurrent [/ip address get [ find interface=$WANInter ] address ] | |
:local NOIPaddr [:resolve $NOIPDomain] | |
:for i from=( [:len $IpCurrent] - 1) to=0 do={ | |
:if ( [:pick $IpCurrent $i] = "/") do={ | |
:local NewIP [:pick $IpCurrent 0 $i] | |
:if ( $NOIPaddr != $NewIP ) do={ | |
/tool fetch mode=http user=$NOIPUser password=$NOIPPass url="http://dynupdate.no-ip.com/nic/update\3Fhostname=$NOIPDomain&myip=$NewIP" keep-result=no; | |
:log info "NO-IP Update $NewIP"; | |
}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment