To mimick the behaviour of copying a config from one device to another Im utilizing reset-configuration in Mikrotik like so:
/system reset-configuration keep-users=yes no-defaults=yes skip-backup=yes run-after-reset=flash/custom.rsc
However I fail to get the script to output info to the console while being runned during reset-configuration.
I have attempted this:
# Add 30 second delay for reset-configuration to work properly
:put "Waiting 30 seconds before applying custom configuration...";
:delay 30;
# Applying configuration
:put "Applying custom configuration...";
But when runned all I see after the initial reboot is:
MikroTik 7.15.2 (stable)
NEW-MIKROTIK Login:
So whats the proper way to output info to the console while the script is being runned with reset-configuration?
How does it write to the terminal, if the script is launched from an internal session?
You have to launch it in the terminal yourself, if you want to see the results of the script.
Same way as whatever is writing "Resetting configuration..." to the console?
After all its a regular linux in the backend and with that you can do just "echo msg" to have that being displayed during boot on a regular linuxbox. But that capability seems to have been removed when running scripts for reset-configuration?
I found this that can output to a local file but its not really what Im looking for:
https://github.com/joncutrer/perfectrestore
All I want is to be able to print to the console various stages of my custom.rsc when being runned by reset-configuration.
It works when I run it as /import after I have logged in to the box but I would prefer if this could be done with a single command through reset-configuration instead of 3-4 different steps.