Community discussions

MikroTik App
 
Jeroen1000
Member Candidate
Member Candidate
Topic Author
Posts: 205
Joined: Fri Feb 18, 2011 2:05 pm

Simple script works in terminal but not via RUN script

Tue May 09, 2017 5:13 pm

Code: Select all

:global isIPcurrent;

:if ($isIPcurrent!=$currentIP) do={
:log info "YES"
:set $isIPcurrent $currentIP;
/user set sshuser address=($currentIP,/32,192.168.200.0/24) }
So this works when pasted in terminal but not when I paste it in a new script and run it. I really don't understand why? Any clues:-)?
 
User avatar
ahmedalmi
Frequent Visitor
Frequent Visitor
Posts: 75
Joined: Sat Sep 13, 2014 5:52 pm
Location: sana'a yemen
Contact:

Re: Simple script works in terminal but not via RUN script

Sat May 13, 2017 3:47 am

write your script between { } , and remove comma in ($currentIP,/32,192.168.200.0/24) like this ($currentIP/32,192.168.200.0/24)

your script will be:

{
:global isIPcurrent;

:if ($isIPcurrent!=$currentIP) do={
:log info "YES"
:set $isIPcurrent $currentIP;
/user set sshuser address=($currentIP/32,192.168.200.0/24) }
}

Who is online

Users browsing this forum: No registered users and 9 guests