arm_dead_man
Arm a self-removing RouterOS scheduler that reverts specified commands after 1-60 minutes unless cancelled, guarding risky writes against lockout.
Instructions
Arm a local, self-removing RouterOS scheduler on device_name
that reverts a change after minutes (1-60) unless cancelled first
(cancel_dead_man) - the anti-lockout primitive behind every
LOCKOUT-RISK write in this package (set_wireless_channel/
set_wireless_tx_power use it automatically by default). See
README's "Dead-man / lockout-proof writes" section for the full
design and the real-hardware incident that validated it.
NOT wireless-specific: revert_commands is any non-empty list (max
10 items) of RouterOS script statements that restore a known-good
prior state - a route, a bridge port, a firewall rule, anything -
run in order when the dead-man fires, after logging a warning
(visible in logs/security_events) and before the scheduler
removes itself. Build each command from state you already read from
the device, not free-form text.
The returned preview's after["name"] (also after more broadly)
is the exact scheduler that would be armed (or was armed, if
confirm=True) - pass that name to cancel_dead_man once the
change it guards is confirmed good.
WRITE tool, guarded: blocked entirely unless the server is running with MIKROTIK_ALLOW_WRITE=true. Call with confirm=False (the default) to preview the exact scheduler that would be armed without touching the device; call again with confirm=True to actually arm it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | ||
| minutes | No | ||
| device_name | Yes | ||
| revert_commands | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||