Additional Features; Script Repository - MikroTik RouterOS v2.9 Reference Manual

Reference manual
Table of Contents

Advertisement

sent-bits-per-second: 0bps
Global Variables
i=1
Local Variables
sent-bits-per-second=0
received-packets-per-second=0
received-bits-per-second=0
sent-packets-per-second=0
[admin@MikroTik] interface>

Additional Features

Description
To include comment in the console script prefix it with '#'. In a line of script that starts with '#' all
characters until the newline character are ignored.
To put multiple commands on a single line separate them with ';'. Console treats ';' as the end of line
in scripts.
Any of the {}[]"'\$ characters should be escaped in a reqular string with '\' character. Console takes
any character following '\' literally, without assigning any special meaning to it, except for such
cases:
\a
bell (alarm), character code 7
\b
backspace, character code 8
\f
form feed, character code 12
\n
newline, character code 10
\r
carriage return, character code 13
\t
tabulation, character code 9
\v
vertical tabulation, character code 11
\_
space, character code 32
Note that '\', followed by any amount of whitespace characters (spaces, newlines, carriage returns,
tabulations), followed by newline is treated as a single whitespace, except inside quotes, where it is
treated as nothing. This is used by console to break up long lines in scripts generated by export
commands.

Script Repository

Home menu level: /system script
Description
All scripts are stored in the /system script menu along with some service information such as script
name, script owner, number of times the script was executed and permissions for particular script.
In RouterOS, a script may be automatically started in three different ways:
via the scheduler
on event occurence - for example, the netwatch tool generates an event if a network host it is
configured to monitor becomes unaccessible
by another script
It is also possible to start a script manually via /system script run command.
Copyright 1999-2007, MikroTik. All rights reserved. Mikrotik, RouterOS and RouterBOARD are trademarks of Mikrotikls SIA.
Other trademarks and registred trademarks mentioned herein are properties of their respective owners.
Page 645 of 695

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents