Community discussions

MikroTik App
 
sergeda
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 78
Joined: Wed Sep 20, 2006 6:03 am

can't add script source, example from Wiki Improved Netwatch

Sat Apr 26, 2008 12:57 pm

Hi to all.
I'm trying to use part of code from example "Improved Netwatch" from Wiki in my script.
The script I'm trying to add is: system script add name="test2" source=":local i 0; {:do {:set i ($i + 1)} while i<5) && ([/ping 192.168.61.2 interval=3 count=1]=1)}"
Every time I'm trying this to add I've got the error: invalid argument name
I'm new to scripting and just learning so I can't understand what's wrong with this code. Can somebody help me with this?
Router os 2.9.51
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7195
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: can't add script source, example from Wiki Improved Netwatch

Mon Apr 28, 2008 2:05 pm

add source=":local i 0; {:do {:set i (\$i + 1)} while i<5) && ([/ping 192.168.61.2 interval=3 count=1]=1)}"
 
sergeda
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 78
Joined: Wed Sep 20, 2006 6:03 am

Re: can't add script source, example from Wiki Improved Netwatch

Mon Apr 28, 2008 2:30 pm

add source=":local i 0; {:do {:set i (\$i + 1)} while i<5) && ([/ping 192.168.61.2 interval=3 count=1]=1)}"
Thank you a lot.