S
S
severnik2020-09-27 14:43:16
network hardware
severnik, 2020-09-27 14:43:16

How to configure Mikrotik so that when you press the Mode button, the last configuration from backup is restored?

I took Mikrotik HAP ac2 to replace an old router from another manufacturer. I try to twist-tune different things on it and in the process sometimes I stuff bumps, scaling it. I know that there is Safe mode in WinBox, but sometimes I also forget to turn it on.

You have to reset it with the Reset button. She is very tight and uncomfortable there. I don’t know, maybe I got such a copy and everything is fine in others. Who designed it so that Reset and its indication LED are a few millimeters apart is also unclear. It turns out that I cover the LED with my finger, which should blink to indicate a reset. If it were a recessed button, as they did before, which had to be pressed with a paper clip, there would be no questions.

And then I still roll backup after the reset. It would be convenient to configure the Mode button for this, which is next to the USB port, with the parameters:

  • Pressing - restore the last configuration from backup
  • Hold 5sec. - factory reset

Can you please tell me how this can be implemented? At least one of the modes.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
severnik, 2020-11-10
@severnik

I will supplement my answer with a solution, because. the option to download the backup turned out to be non-working (Mikrotik requires confirmation of the command).
First, we export the settings to a text file with the command
/export file=flash/resetBackup
add to scripts

/system script add name=reset-backup source={/system reset-configuration keep-users=yes no-defaults=yes run-after-reset=flash/resetBackup.rsc}

and hang the script on the button
/system routerboard mode-button set on-event=reset-backup enabled=yes

D
Dmitry Shitskov, 2020-09-27
@Zarom

/system script add name=load-backup source={/system backup load name=backup_name}
/system routerboard mode-button set on-event=load-backup enabled=yes

factory reset is more difficult to script due to the fact that invoking the command displays a confirmation prompt. https://forum.mikrotik.com/viewtopic.php?t=121491

S
Sergey Ivanov, 2021-01-05
@bropines

Is it possible to bind a button to turn WiFi on and off? I am new to Microtik

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question