routeros-scripting
Installation
SKILL.md
RouterOS scripting
A script is a list of console commands plus a small language (variables, conditions, loops, functions). Commands run line by line until the end or a runtime
error. Scripts live in /system/script or are written inline in event properties (on-event, up-script, ...). Use the CLI path style /ip/firewall/filter/add ...
(slash-separated, as everywhere in this repository) or the space style; both work.
Check a script file before applying it
.rsc files (also what /export writes) are applied with /import. verbose=yes dry-run simulates it and reports syntax errors without changing the configuration;
dry-run works only in verbose mode.
bash scripts/dry-run-import.sh --host 192.0.2.1 --user admin my-config.rsc
./scripts/dry-run-import.ps1 -HostName 192.0.2.1 -User admin my-config.rsc