Could you please help fix my script below:
Code: Select all
# Update Hurricane Electric DDNS IPv4 address
:local ddnshost "some.host.name"
:local key "secret"
:local updatehost "dyn.dns.he.net"
:local outputfile ("HE_DDNS" . ".txt")
# Internal processing below...
# ----------------------------------
:local ipv4addr
# Get WAN interface IP address
:set ipv4addr [/ip address get [/tool fetch url="http://myip.dnsomatic.com/" mode=http] address]
:set ipv4addr [:pick [:tostr $ipv4addr] 0 [:find [:tostr $ipv4addr] "/"]]
:log info ("Updating DDNS IPv4 address" . " Client IPv4 address to new IP " . $ipv4addr . "...")
/tool fetch url="http://$ddnshost:$key@$updatehost/nic/update?hostname=$ddnshost&myip=$ipv4addr" \
dst-path=$outputfile
:log info ([/file get ($outputfile) contents])
#/file remove ($outputfile)
Thank you and I love hearing from you soon.