Page 1 of 1

Running scripts after /system reset

Posted: Tue Sep 06, 2005 3:02 pm
by rui
To enable an easy way for users to set up routers from a selection of standard configuration files, I would like to run /system reset (to clear all existing configurations) followed by a script with the new configuration.

Is there any way to make MT run a script on boot (after /system reset) ?

If not then consider the following:

Is there an other way to set all values to default without using /system reset or going through all submenus. The problem is that if you don't know the current setup, the script will stop if it encounters an error leaving the system in an "unknown state". This can of course be done with extensive checking, but is there an easy way ?

Thanks
rui[/b]

Posted: Thu Sep 08, 2005 4:33 am
by sten
A / system reset would also remove all scripts.

I wish for such a feature too though. Kind of like when / system reset or system is rebooted (even when blank) if it finds a certain filename it will import this file.

Posted: Thu Sep 08, 2005 9:48 am
by cmit
I'm begging for this for months, well, more for years now...

It would be so eeeaaaaasy to implement, and could be a saver so many times...

Posted: Thu Sep 08, 2005 9:53 am
by normis
how about `configure` script in Netinstall?

Posted: Thu Sep 08, 2005 9:57 am
by cmit
That's NOT the same. I know that netinstall provides this feature.

What we are talking about is being able to put a script - say "default.rsc" or whatever it's name is - onto the router. After doing a "/system reset" (!) the router will clear all config and THEN execute this script.

One example for usefulness: After upgrading a router from 2.8.x. to 2.9.x things are "strange", as sometimes configs aren't upgraded fully (which is OK for - just too many changes...).
If this router is only reachable remotely you could now put the commands for a basic setup into this default.rsc, so after the reset the router would be reachable to do the rest of the config again, without having to get physically at the routers' location.

And I know this would be trivial to implement ;)

Please, please :) (no, I'm NOT crying...)

Posted: Thu Sep 08, 2005 11:18 am
by sten
Or how about something that get's automatically imported right after bootup?

- We could reinstall default configuration on remote units
- Bootup initialization of global variables
- FTP upload scripts and reboot the router for maintenance jobs without being dependant on connectivity.
- Send that famous backup e-mail.
- Plant little surprises for the installers just to shake things up a bit.
- Reinstall default configuration so the damn things becomes accessible again! :)

Posted: Thu Sep 08, 2005 12:05 pm
by rui
The netinstall config-script is excellent for new installations.

The same functionality would be great on a running system.

Just as cmit points out in his reply ( default.rsc or something ) :-)

The main reason for running a /system reset is to get a "clean" basis for implementing the new configuration. This can be done with mac-telnet (on 2.9) on embedded systems without a serial port. All users, however, are not comfortable using ftp and mac-telnet for running the script with the new settings.

Posted: Thu Sep 08, 2005 12:11 pm
by cmit
Well, if you have a REALLY REMOTE system, MAC-telnet won't work, as you need a layer 2 connection to the router - which you won't necessarily have...

Posted: Thu Sep 08, 2005 12:23 pm
by rui
That's true. I was writing with a specific implementation in mind, sorry.

Anyway. It would be a nice feature to have :-)

Posted: Sun Sep 18, 2005 2:38 pm
by sten
LoL, we asked for a way to AUTOMATICALLY IMPORT A SCRIPT on RESET/REBOOT. Next version a scheduler option to RUN a script at startup is added. This misses the mark completely.

Sometimes i wonder if it's the language barrier or deliberate.

A feature where one could IMPORT a script (.rsc) at bootup (which would cover never configured and resetted units) would save a whole lot of money and hours for the people who operate or manufacture routeros based routers.

At my old job where we put together routeros based routers;
I don't know how many units i've had to open up, add cable, type in IP, ftp file and import, because of mistakes like operator types "/ system reset" when he should have typed "/ system reboot" (Or same operation in winbox). No matter how many uppercase warnings and confirmations asked, people will still hit "Y"/"OK" until the box reboots.
It's like the brain shuts down because it knows it soon has to wait.

MANY times the configuration goes blank due to some obscure bug in the system. I don't care what other people say that this doesn't happen, if a system has a bug, we will sooner rather than later find it and trigger it.

Why is it so hard to implement this feature?

Re: Running scripts after /system reset

Posted: Thu Jun 26, 2008 10:42 pm
by davidw
Has the feature been implemented yet ?

I too want to be able to run a script after a system reset

Some thing like

/system reset "bootup.rsc"

would be nice.