
# though they are also defined in the script we call to set them. # We need to use the following globals which must be defined here even :global SYSntpb "1.uk." # Check and set NTP servers - "setntppool" # NTP pools to use (check :global SYSntpa "0.uk." Note Script Editor does not include JavaScript templates at this time. :global SYSsendemail E-mail address to send notifications from Script Editor includes a number of built-in templates for creating common types of AppleScripts, including droplets, Mail rule scripts, and Messages handler scripts. # E-mail address to send notifications to # System configuration script - "GlobalVars" The first defines some system variables which are used in other scripts and the second does the grunt work: This script is required as RouterOS does not allow hostnames to be used in the NTP configuration. This script resolves the hostnames of two NTP servers, compares the result with the current NTP settings and changes the addresses if they're different.
AUTO SCRIPT WRITER 2 MAC
:set message message] Īfter new entry is detected, it is saved in "message" variable, which you can use later to parse log message, for example, to get pppoe clients mac address.Īllow use of ntp.org pool service for NTP Now we can write a script to detect if new entry is added. :for i from=( - 1) to=0 do= while ($lineEnd /log print where buffer=pppoeġ3:11:08 pppoe,info PPPoE connection established from 00:0C:42:04:4C:EE This script is useful if you need ip address without netmask (for example to use it in firewall), but " /ip address get address" returns ip address and netmask. :put "ip address $currentIP changed to $newIP" This script will compare if dynamic IP address is changed. Sometimes provider gives dynamic IP addresses. In v3.x it is not possible to create file directly, however there is a workaround Script examples used in this section were tested with the latest 3.x version. This section contains some useful scripts and shows all available scripting features. 2.3 Include custom function in another script.1.14 Other scripts known to work with latest v3.x.1.12 Allow use of ntp.org pool service for NTP.1.8 Check bandwidth and add limitations.


1.2 Check if IP on interface have changed.
