Page 1 of 1

Can't export script correctly?

Posted: Mon Aug 20, 2007 9:42 pm
by REDTDI
I have tried to export a couple of scripts that I created in winbox from my 2.9.43 router. I got garbage out. Is this a known bug with MikroTik? I have also tried to create my scripts manually in Terminal and keep getting an invalid argument message.

The script I want to import to Terminal is:

/system script add name=scriptDailyReset policy=ftp,reboot,read,write,policy,test,winbox,password source=":put [/ip firewall mangle reset-counters-all];"

If I remove the [] the script imports but doesn't run.

Please help!

Ken

Re: Can't export script correctly?

Posted: Tue Aug 21, 2007 9:41 am
by mrz
If I remove the [] the script imports but doesn't run.
Sure it won't work because script has syntax error if you remove [].

And I don't actually understand where is the problem.

Re: Can't export script correctly?

Posted: Thu Aug 23, 2007 4:06 pm
by karo84
Yes it is right, when I export the scripts, I see some "\", or "/" , I don't understand Why?
What do they mean ? why they are created?

And at last when import script it doesn't work correctly, or doesn't work at all, Can You Explain this situation?

Re: Can't export script correctly?

Posted: Thu Aug 23, 2007 4:12 pm
by mrz
/ is created to execute command from root menu
\ allows to execute multiple lines as single line. For example:

/ip address add address=10.1.101.1/24 broadcast=10.1.101.255 \
interface=ether1 network=10.1.101.0

is the same as:
/ip address add address=10.1.101.1/24 broadcast=10.1.101.255 interface=ether1 network=10.1.101.0

Re: Can't export script correctly?

Posted: Thu Aug 23, 2007 9:16 pm
by karo84
Thanks for explanation