Community discussions

 
REDTDI
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Fri May 28, 2004 9:41 pm

Can't export script correctly?

Mon Aug 20, 2007 9:42 pm

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
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5942
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Can't export script correctly?

Tue Aug 21, 2007 9:41 am

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.
 
User avatar
karo84
Member Candidate
Member Candidate
Posts: 194
Joined: Fri Aug 17, 2007 9:06 am

Re: Can't export script correctly?

Thu Aug 23, 2007 4:06 pm

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?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 5942
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Can't export script correctly?

Thu Aug 23, 2007 4:12 pm

/ 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
 
User avatar
karo84
Member Candidate
Member Candidate
Posts: 194
Joined: Fri Aug 17, 2007 9:06 am

Re: Can't export script correctly?

Thu Aug 23, 2007 9:16 pm

Thanks for explanation

Who is online

Users browsing this forum: No registered users and 9 guests