Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :local dmeuser "user@email.com"
- :local ddnsid "1234567"
- :local ddnspassword "recordpassword"
- # Name of the public/external interface
- :local inetinterface "ether1-gateway"
- :global oldIP;
- :if ([/interface get $inetinterface value-name=running]) do={
- :local currentIP [/ip address get [find interface="$inetinterface" disabled=no] address];
- # Strip the net mask off the IP address
- :for i from=( [:len $currentIP] - 1) to=0 do={
- :if ( [:pick $currentIP $i] = "/") do={
- :set currentIP [:pick $currentIP 0 $i]
- }
- }
- :if ($currentIP != $oldIP) do={
- :set oldIP $currentIP
- :local url "http://www.dnsmadeeasy.com/servlet/updateip\3F&username=$dmeuser&password=$ddnspassword&id=$ddnsid&ip=$currentIP"
- /tool fetch url=($url) mode=http dst-path=("dmeupdate-" . $ddnsid . ".txt")
- :log info "DNSMadeEasy: Record $ddnsid updated to $currentIP"
- }
- } else={
- :log info "DNSMadeEasy: $inetinterface is not currently running."
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement