Page 1 of 1

ASK [reset-button]

Posted: Wed Jul 01, 2020 1:50 am
by nichky
i got hEX S
im wondering does anyone have any useful script for

/system routerboard reset-button ?

Re: ASK [reset-button]

Posted: Wed Jul 01, 2020 9:26 am
by eworm
Would you consider this to be useful?
Mode botton with multiple presses

Re: ASK [reset-button]

Posted: Wed Jul 01, 2020 10:50 am
by Zacharias
I don't understand, what should the script do ?

Re: ASK [reset-button]

Posted: Wed Jul 01, 2020 11:48 am
by eworm
This is part of my RouterOS Scripts collection. You can make the device act on multiple presses on mode or reset button. The default is one press to toggle dark mode, two presses for a "Hello World" notification, three presses for shutdown, ... But you can make it do what ever you want.

Re: ASK [reset-button]

Posted: Mon Jul 06, 2020 8:48 am
by nichky
i want to enable/disable interface on CAPsMAN interface using /system routerboard reset-button.
@eworm is there any further help about this?

Re: ASK [reset-button]

Posted: Mon Jul 06, 2020 11:53 am
by eworm
Using my scripts add something like this in configuration:
:global ModeButton {
  1="/ caps-man interface disable [ find ];";
  2="/ caps-man interface enable [ find ];";
}
With one press all interfaces are disabled, with two presses interfaces are enabled. Is that what you want?

Of course you could script a simple toggle without my scripts.

Re: ASK [reset-button]

Posted: Mon Jul 06, 2020 1:39 pm
by nichky
yess,would be able to correct that one


:global ModeButton { [/caps-man interface get [find name="cap1"] disabled];
:if (gueststate = yes) do={
:log info "enabled"
/caps-man interface disable [ find name=cap1 ];
:log info "disabled"
/caps-man interface enable [ find name=cap1 ];
}

Re: ASK [reset-button]

Posted: Mon Jul 06, 2020 4:29 pm
by eworm
No idea what you code is supposed to do.
Do you want to toggle the interface without my scripts? Use something like this then:
:if ([ / caps-man interface get cap1 disabled ] = true) do={
  :log info "Enabling...";
  / caps-man interface enable cap1;
} else={
  :log info "Disabling...";
  / caps-man interface disable cap1;
}

Re: ASK [reset-button]

Posted: Tue Jul 07, 2020 1:12 am
by nichky
that i was looking for