Community discussions

MikroTik App
 
rui
just joined
Topic Author
Posts: 7
Joined: Wed Mar 23, 2005 10:10 am
Location: Horten, Norway

Running scripts after /system reset

Tue Sep 06, 2005 3:02 pm

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]
 
sten
Forum Veteran
Forum Veteran
Posts: 920
Joined: Tue Jun 01, 2004 12:10 pm

Thu Sep 08, 2005 4:33 am

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.
 
cmit
Forum Guru
Forum Guru
Posts: 1552
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Thu Sep 08, 2005 9:48 am

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...
Best regards,
Christian Meis
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24645
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Thu Sep 08, 2005 9:53 am

how about `configure` script in Netinstall?
 
cmit
Forum Guru
Forum Guru
Posts: 1552
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Thu Sep 08, 2005 9:57 am

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...)
Best regards,
Christian Meis
 
sten
Forum Veteran
Forum Veteran
Posts: 920
Joined: Tue Jun 01, 2004 12:10 pm

Thu Sep 08, 2005 11:18 am

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! :)
 
rui
just joined
Topic Author
Posts: 7
Joined: Wed Mar 23, 2005 10:10 am
Location: Horten, Norway

Thu Sep 08, 2005 12:05 pm

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.
 
cmit
Forum Guru
Forum Guru
Posts: 1552
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Thu Sep 08, 2005 12:11 pm

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...
Best regards,
Christian Meis
 
rui
just joined
Topic Author
Posts: 7
Joined: Wed Mar 23, 2005 10:10 am
Location: Horten, Norway

Thu Sep 08, 2005 12:23 pm

That's true. I was writing with a specific implementation in mind, sorry.

Anyway. It would be a nice feature to have :-)
 
sten
Forum Veteran
Forum Veteran
Posts: 920
Joined: Tue Jun 01, 2004 12:10 pm

Sun Sep 18, 2005 2:38 pm

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?
 
davidw
Frequent Visitor
Frequent Visitor
Posts: 91
Joined: Fri Apr 27, 2007 11:11 pm

Re: Running scripts after /system reset

Thu Jun 26, 2008 10:42 pm

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.

Who is online

Users browsing this forum: No registered users and 18 guests