In the 6.4 version of my script variables have a problem, someone can help me solve it
My English is coming through Google Translate, please forgive me
local ipaddr
local server "http://ddns.oray.com"
local domain "domain.gicp.net"
local par "/ph/update?&hostname=$domain&myip=$ipaddr"
local users "username"
local paswd "abc123"
:set ipaddr [/ip address get [/ip address find interface=pppoe-out1] address]
:set ipaddr [:pick $ipaddr 0 ([len $ipaddr] -3)]
/tool fetch url=($server . $par) mode=http user=$users password=$paswd
The variable $ipaddr does not have a value when it is assigned to the variable $par. Reorder the statements to something like this:
local ipaddr
local server "http://ddns.oray.com"
local domain "domain.gicp.net"
local users "username"
local paswd "abc123"
:set ipaddr [/ip address get [/ip address find interface=pppoe-out1] address]
:set ipaddr [:pick $ipaddr 0 ([len $ipaddr] -3)]
# Move this line to here so that $ipaddr has a value
local par "/ph/update?&hostname=$domain&myip=$ipaddr"
/tool fetch url=($server . $par) mode=http user=$users password=$paswd