Community discussions

MikroTik App
 
mbcolangelo
just joined
Topic Author
Posts: 8
Joined: Fri Apr 20, 2012 6:33 pm

no-ip update script work but fails as a scheduled task

Wed Nov 20, 2013 4:58 pm

I've got a no-ip update script. Works great if I run it manually but when ran as a scheduled task it fails.

The script is right from the wiki.

Any ideas? It's set to run every 5 minutes
##############Script Settings##################

:local NOIPUser "username@bleh.com"
:local NOIPPass "pass"
:local WANInter "CTDSL"

###############################################
log info "running update-no-ip script"
:local NOIPDomain "myhostname.no-ip.biz"
:local IpCurrent [/ip address get [find interface=$WANInter] address];
:for i from=( [:len $IpCurrent] - 1) to=0 do={
:if ( [:pick $IpCurrent $i] = "/") do={
:local NewIP [:pick $IpCurrent 0 $i];
:if ([:resolve $NOIPDomain] != $NewIP) do={
/tool fetch mode=http user=$NOIPUser password=$NOIPPass url="http://dynupdate.no-ip.com/nic/update\3 ... yip=$NewIP" keep-result=no
:log info "NO-IP Update: $NOIPDomain - $NewIP"
}
}
}


** EDIT **
I just looked at the run count on the scheduled tasks and the scripts --- The scheduled task just ran but the script's run count did not increase.
 
LinFor
just joined
Posts: 14
Joined: Sun Nov 17, 2013 10:16 am
Location: Moscow

Re: no-ip update script work but fails as a scheduled task

Wed Nov 20, 2013 5:27 pm

Policy?
 
mbcolangelo
just joined
Topic Author
Posts: 8
Joined: Fri Apr 20, 2012 6:33 pm

Re: no-ip update script work but fails as a scheduled task

Thu Nov 21, 2013 7:14 pm

I have all the policy boxes checked.

Changing
log info "running update-no-ip script"

To
: log info "running update-no-ip script"

Got it running but it still doesn't update no-ip.
I see the entry in the log from it running but I check no-ip and nothin


Sent from my Xoom using Tapatalk 4
 
LinFor
just joined
Posts: 14
Joined: Sun Nov 17, 2013 10:16 am
Location: Moscow

Re: no-ip update script work but fails as a scheduled task

Fri Nov 22, 2013 9:20 am

Try also replace "\3F" with "?"
 
mbcolangelo
just joined
Topic Author
Posts: 8
Joined: Fri Apr 20, 2012 6:33 pm

Re: no-ip update script work but fails as a scheduled task

Mon Nov 25, 2013 12:46 am

I should have updated sooner, sry. I did end up resolving the issue. Still not sure exactly what the issue was but I got irritated enough to completely rewrite the scripts from scratch, completely discarding what I found in the wiki.

I'll post them next chance I get. This dns update script was also used in conjunction with a ipsec update script to automate reestablishing the tunnels.

Maybe they can be contributed to wiki, I dunno. They are very reliable now and by my estimate they manage to get the ipsec tunnels back in business in no more then 10 minutes (2 tunnels)

Sent from my Xoom using Tapatalk 4

Who is online

Users browsing this forum: No registered users and 44 guests