System information
Manual:Scripting
37
Property Description
name (string) Variable name
user (string) User who defined variable
value () Value assigned to variable
Job
Sub-menu level: /system script job
Contains list of all currently running scripts.
Read only status properties:
Property Description
owner (string) User who is running script
policy (array) List of all policies applied to script
started (date) Local date and time when script was started
Manual:Scripting-examples
CMD Scripting examples
This section contains some useful scripts and shows all available scripting features. Script examples used in this
section were tested with the latest 3.x version.
Create a file
In v3.x it is not possible to create file directly, however there is a workaround
/file print file=myFile
/file set myFile.txt contents=""
Check if IP on interface have changed
Sometimes provider gives dynamic IP addresses. This script will compare if dynamic IP address is changed.
:global currentIP;
:local newIP [/ip address get [find interface="ether1"] address];
:if ($newIP != $currentIP) do={
:put "ip address $currentIP changed to $newIP";
:set currentIP $newIP;
}