I have a test.rsc file with the following contents saved on my router:
/interface wifi
# managed by CAPsMAN
# mode: AP, SSID: iris, channel: 5720/ax/eeeC
set [ find default-name=wifi1 ] configuration.manager=capsman datapath=capdp disabled=no
Running
ssh -t my-router "/import test.rsc verbose=yes dry-run; quit"
(or just
/import test.rsc verbose=yes dry-run
in an interactive terminal) produces the following output
#line 1
/interface wifi
#line 2
# managed by CAPsMAN
#line 3
# mode: AP, SSID: iris, channel: 5720/ax/eeeC
#line 4
set [ find default-name=wifi1 ] configuration.manager=capsman datapath=capdp disabled=no
No syntax errors found in the import file
interrupted
But running
ssh -T my-router "/import test.rsc verbose=yes dry-run; quit"
(notice the use of capital
-T
instead of
-t
, this disables pseudo-terminal allocation, making this a non-interactive ssh session) produces:
#line 1
/interface wifi
#line 2
# managed by CAPsMAN
#line 3
# mode: AP, SSID: iris, channel: 5720/ax/eeeC
#line 4
set [ find default-name=wifi1 ] configuration.manager=capsman datapath=capdp disabled=no
expected end of command (line 4 column 24)
Script Error: found 1 error(s) in import file
So it seems that
dry-run
import changes its semantics based on whether the current shell is interactive or not (which is really weird).
I am on RouterOS 7.16.1 and I have reproduced this bug on both my cAP ax and RB5009UPr+S+IN.
Also,
/export terse
generates the above-mentioned split interface command (with the “managed by CAPsMAN” comment in the middle). It seems to me that terse doesn’t normally insert line breaks in the middle of commands, unlike compact, so this command splitting also might be a separate bug.
P.S. Does Mikrotik have a bug tracker or something?