電訊茶室's Archiver

角色 發表於 2014-12-28 12:38

【RouterOS】—— Full Screen Editor

Whenever you need write scripts on your RouterOS, you may need to prepare your scripts on Windows programs such as Notepad or other applications which allow to write your own scripts. Once scripts are completed, you need to move them onto your RouterOS terminal windows (/file folder). Whenever you have problems in your scripts, you need to repeat the same process to re-edit your scripts and move them to the RouterOS /file again.

You can get rid of the above process using the following command

1. Create of a script in /file folder (just printing the current contents to a file named myFile)[code]
/file
print file=myFile
[/code]2. Empty of the file myFile[code]
/file set myFile.txt contents=""
[/code]3. Start to edit the file myFile[code]
/file edit myFile.txt
value-name (just press <Enter> key to continue
[/code]4. A full-screen editor giving you to edit the file myFile.txt and press <CTRL>+<o> to save and exit the full-screen editing mode

vpn-learner 發表於 2018-2-23 00:41

should the script be saved as *.[b]txt[/b] format or *.[b]rsc[/b] format??
or it doesn't matter?

角色 發表於 2018-2-23 00:55

In general I would like to prefer .txt format to .rsc format. I am sorry that I forgot the use of .rsc format.

gfx86674 發表於 2018-2-23 02:20

[i=s] 本帖最後由 gfx86674 於 2018-2-23 08:04 編輯 [/i]

感覺就像linux上的vi與nano,但還是在windows用記事本編輯好再上傳覆蓋比較方便。

vpn-learner 發表於 2018-2-24 17:23

请教: 如果我copy 师兄们的scripts 到winbox, 是应该copy在 New Terminal 还是 在 schedule里呢? 我看教程 两种都有人做!?

gfx86674 發表於 2018-2-24 18:13

[i=s] 本帖最後由 gfx86674 於 2018-2-25 00:01 編輯 [/i]

[quote]请教: 如果我copy 师兄们的scripts 到winbox, 是应该copy在 New Terminal 还是 在 schedule里呢? 我看教 ...
[size=2][color=#999999]vpn-learner 發表於 2018-2-24 17:23[/color] [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44488&ptid=6490][img]http://www.telecom-cafe.com/forum/images/common/back.gif[/img][/url][/size][/quote]
schedule是排程,是安排時間運作script。
貼在new terminal則是即刻執行script,
但要在您找到的script的
第一行最前面加上{
最後一行最尾端加上 }

這樣貼到new terminal的所有文字才會被當成一個完整的script看待,
若不加上面的括弧,會被當成一行一個script,然後跑出一堆錯誤(貼上去的文字會因錯誤變成紅字)

vpn-learner 發表於 2018-2-24 18:28

[b]回復 [url=http://www.telecom-cafe.com/forum/redirect.php?goto=findpost&pid=44490&ptid=6490]6#[/url] [i]gfx86674[/i] [/b]


    明白了,谢谢 gfx86674 师兄!

頁: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.