Community discussions

MikroTik App
 
User avatar
bax
Member Candidate
Member Candidate
Topic Author
Posts: 268
Joined: Mon Dec 20, 2004 8:45 pm
Location: Croatia

Script not working ?

Sun Feb 13, 2011 10:12 pm

I have already asked on group userman, but it seems that this group is a better place for the question.
This is command which is working fine in terminal window:
/tool user-manager user set 26 name=test password=test group-name=2M subscriber=admin disabled=no
But when I put these on script and try to start then is not working:
/system script
add name=test-on-2M-speed policy=\
    ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive source="/tool user-man\
    ager user set 25 name=test password=test group-name=2M subscriber=admin disabled=\
    no\r\
    \n:log info \"test speed is 2M\""
And also there is something related with scheduler here you can see:
52   name="test-on-2M-speed" start-date=feb/06/2011 start-time=00:06:00 interval=1w on-event=test-on-2M-speed 
     owner="admin" policy=reboot,read,write,policy,test,password,sniff,sensitive run-count=0 
     next-run=feb/20 00:06:00
 
start-date=feb/06/2011
interval=1w
next-run=feb/20 00:06:00
it will need to be next-run=feb/13 00:06:00
Is this some bug?
Any help?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Script not working ?

Sun Feb 13, 2011 10:37 pm

Don't refer to items by their number in scripts. Item numbers are only for humans on the CLI. Use a find command instead to find the item first.

Today is the 13th, so it ran today. It started on the 6th, ran on the 13th already, so the next run is on the 20th.
 
User avatar
bax
Member Candidate
Member Candidate
Topic Author
Posts: 268
Joined: Mon Dec 20, 2004 8:45 pm
Location: Croatia

Re: Script not working ?

Sun Feb 13, 2011 11:03 pm

Thanks!
And just for the records ... command need to be like here:
/tool user-manager user set [/tool user-manager user find comment="test"] name=test password=test group-name=test subscriber=admin disabled=no

Who is online

Users browsing this forum: No registered users and 37 guests