Community discussions

MikroTik App
 
li7862756
just joined
Topic Author
Posts: 2
Joined: Mon May 30, 2011 7:22 am

Oray DDNS Help

Thu Oct 03, 2013 5:40 pm

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
 
User avatar
TealFrog
just joined
Posts: 23
Joined: Sun Oct 02, 2011 11:56 am

Re: Oray DDNS Help

Sat Oct 05, 2013 9:28 am

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
TealFrog

Who is online

Users browsing this forum: No registered users and 13 guests