Community discussions

MikroTik App
 
User avatar
mojiro
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 91
Joined: Sun Jul 24, 2005 9:21 pm

ChangeIp.Com Script Problem

Wed Jun 17, 2009 10:38 am

Hello,

I use the 3.x script from Wiki but when I execute the script from console, I receive the following message:
[xxx@mojiro.awmn] > / system script run xxx.xxx.com 
interrupted
           input does not match any value of value-name
[xxx@mojiro.awmn] > 
 
csickles
Forum Guru
Forum Guru
Posts: 1255
Joined: Fri May 28, 2004 8:46 pm
Location: Phoenix, AZ
Contact:

Re: ChangeIp.Com Script Problem

Wed Jun 17, 2009 6:30 pm

I am NOT a scripting expert...

I looks like you may not have a default route interface that is "not marked" IE routting marks added...

Take a look at the script comments, it is looking for the interface name with a route of 0.0.0.0/0 (route of last resort or default route) WITHOUT routing marks set on it... ( i dont know why it doesnt want marks, you would have to ask Sam..)

I am guessing Sam will probably be the best resource on this one... take a look at his postings.. You will probably find the answer somewhare in them...
 
User avatar
mojiro
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 91
Joined: Sun Jul 24, 2005 9:21 pm

Re: ChangeIp.Com Script Problem

Wed Jun 17, 2009 10:45 pm

Thanks for your help.

Since I do not use routing marks I removed the "gateway" part, which detects the internet interface and I added static resolution of the interface like the 2.9.x script does.
# Define User Variables
:global ddnsuser      "xxx"
:global ddnspass      "xxx"
:global ddnshost      "xxx.xxx.com"
:global ddnsinterface "gw-inet.mojiro.awmn"

# Define Global Variables
:global ddnsip
:global ddnslastip
:if ([ :typeof $ddnslastip ] = nil ) do={ :global ddnslastip "0" }

:global ddnsinterface
:global ddnssystem ("mt-" . [/system package get system version] )

# Grab the current IP address on that interface.
:global ddnsip [ /ip address get [/ip address find interface=$ddnsinterface ] address ]

# Did we get an IP address to compare?
:if ([ :typeof $ddnsip ] = nil ) do={
   :log info ("DDNS: No ip address present on " . $ddnsinterface . ", please check.")
} else={

  :if ($ddnsip != $ddnslastip) do={
    :log info "DDNS: Sending UPDATE!"
    :log info [ :put [/tool dns-update name=$ddnshost address=[:pick $ddnsip 0 [:find $ddnsip "/"] ] key-name=$ddnsuser key=$ddnspass ] ]
    :global ddnslastip $ddnsip
  } else={ 
    :log info "DDNS: No update required."
  }

}
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Re: ChangeIp.Com Script Problem

Thu Jun 18, 2009 9:37 pm

We have discovered that there is an issue with the current script and are working on an update. The 'interface' parameter is no longer supported under 'ip route' (at least with routing-test) so we are working on a new version. Look for it shortly in the wiki.

Sam

Who is online

Users browsing this forum: No registered users and 22 guests