sergeyfromkomi Posted July 25, 2012 Posted July 25, 2012 (edited) Почему эта команда из терминала выполняется: /system ssh user="ubnt" address="172.16.x.x" command="ifconfig ath0 down" [admin@MikroTik] > system ssh user="ubnt" address="172.16.250.213" command="ifconfig ath0 up" Welcome back! ,а как скрипт - нет ? [admin@MikroTik] > system script print Flags: I - invalid 0 name="script1" owner="admin" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api last-started=jan/02/1970 07:41:27 run-count=1205 source= /system ssh user="ubnt" address="172.16.250.213" command="ifconfig ath0 down" Счётчик выполнения растёт.. Edited July 25, 2012 by sergeyfromkomi Вставить ник Quote
Saab95 Posted July 25, 2012 Posted July 25, 2012 Потому что микротик не дружит с убнт. Вставить ник Quote
sergeyfromkomi Posted July 25, 2012 Author Posted July 25, 2012 Потому что микротик не дружит с убнт. Как-то странно он не дружит... Через терминал микротика, эта же команда отрабатывает как нужно. Может в в кавычках где ошибка? Вставить ник Quote
Saab95 Posted July 25, 2012 Posted July 25, 2012 Можно попробовать кавычки вообще убрать для начала=) Вставить ник Quote
Rus123 Posted July 25, 2012 Posted July 25, 2012 (edited) Можно попробовать кавычки вообще убрать для начала=) Поставьте перед ковычками обратный слешь "\" name="script1" owner="admin" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api last-started=jan/02/1970 07:41:27 run-count=1205 source="/system ssh user=\"ubnt\" address=\"172.16.250.213\" command=\"ifconfig ath0 down\" " http://wiki.mikrotik.com/wiki/Manual:Scripting Constant Escape Sequences Following escape sequences can be used to define certain special character within string: \" Insert double quote \\ Insert backslash \n Insert newline \r Insert carriage return \t Insert horizontal tab \$ Output $ character. Otherwise $ is used to link variable. \? Output ? character. Otherwise ? is used to print "help" in console. \_ - space \a - BEL (0x07) \b - backspace (0x08) \f - form feed (0xFF) \v Insert vertical tab \xx Print character from hex value. Hex number should use capital letters. Edited July 25, 2012 by Rus123 Вставить ник Quote
sergeyfromkomi Posted July 26, 2012 Author Posted July 26, 2012 (edited) Можно попробовать кавычки вообще убрать для начала=) Поставьте перед ковычками обратный слешь "\" name="script1" owner="admin" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api last-started=jan/02/1970 07:41:27 run-count=1205 source="/system ssh user=\"ubnt\" address=\"172.16.250.213\" command=\"ifconfig ath0 down\" " http://wiki.mikrotik.com/wiki/Manual:Scripting Не выходит каменный цветок... Так тоже пробовал: /system ssh user=ubnt address=172.16.250.213 command=\"ifconfig ath0 down\" Странно, что так запускается: [admin@MikroTik] /system script> print Flags: I - invalid 0 name="my" owner="admin" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api last-started=jan/02/1970 00:51:56 run-count=5 source=/system ssh user="ubnt" address="172.16.250.213" command="ifconfig ath0 down" [admin@MikroTik] /system script> run 0 Welcome back! [admin@MikroTik] /system script> Edited July 26, 2012 by sergeyfromkomi Вставить ник Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.