Community discussions

MikroTik App
 
amorsen
newbie
Topic Author
Posts: 37
Joined: Wed Jun 13, 2007 2:17 pm

/import safe-mode (feature request)

Wed Nov 25, 2020 12:14 pm

I have a (hopefully) simple feature request that would make automatic changes on routers more foolproof.

Add a parameter safe-mode to the /import command. When that is set, activate safe-mode before doing the import, and if connection is lost, do the rollback just like regular ctrl-X-style safe mode. Ideally make it mandatory to do a /import confirm within a certain time afterwards, to stop the automatic rollback.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: /import safe-mode (feature request)

Wed Nov 25, 2020 3:55 pm

Enable safe mode and then run import.
 
amorsen
newbie
Topic Author
Posts: 37
Joined: Wed Jun 13, 2007 2:17 pm

Re: /import safe-mode (feature request)

Tue Dec 01, 2020 6:17 pm

Enable safe mode and then run import.
This does not seem to work if you use common libraries. When using ssh programmatically, you tend to send one command and get the result from that command. The next command is sent as a separate entity, having no relation to the previous command. This makes it difficult to enable safe mode.

I have tested that at least with Ruby, you cannot enter safe-mode using the standard Net::SSH interface. Any changes I make after sending ctrl-X unfortunately persist, even if the session is broken unexpectedly.

To get around that limitation, you can open a telnet-like session, but then you have to manualle detect when output is finished, e.g. by matching the prompt. That is what I currently do, but it is error-prone and unreliable. Expect-like interfaces are a lot more difficult to use than the standard SSH libraries that work with most other vendors.

Who is online

Users browsing this forum: No registered users and 19 guests