Community discussions

MikroTik App
 
User avatar
nichky
Forum Guru
Forum Guru
Topic Author
Posts: 1281
Joined: Tue Jun 23, 2015 2:35 pm

ASK [reset-button]

Wed Jul 01, 2020 1:50 am

i got hEX S
im wondering does anyone have any useful script for

/system routerboard reset-button ?
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1071
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: ASK [reset-button]

Wed Jul 01, 2020 9:26 am

Would you consider this to be useful?
Mode botton with multiple presses
 
Zacharias
Forum Guru
Forum Guru
Posts: 3459
Joined: Tue Dec 12, 2017 12:58 am
Location: Greece

Re: ASK [reset-button]

Wed Jul 01, 2020 10:50 am

I don't understand, what should the script do ?
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1071
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: ASK [reset-button]

Wed Jul 01, 2020 11:48 am

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.
 
User avatar
nichky
Forum Guru
Forum Guru
Topic Author
Posts: 1281
Joined: Tue Jun 23, 2015 2:35 pm

Re: ASK [reset-button]

Mon Jul 06, 2020 8:48 am

i want to enable/disable interface on CAPsMAN interface using /system routerboard reset-button.
@eworm is there any further help about this?
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1071
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: ASK [reset-button]

Mon Jul 06, 2020 11:53 am

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.
 
User avatar
nichky
Forum Guru
Forum Guru
Topic Author
Posts: 1281
Joined: Tue Jun 23, 2015 2:35 pm

Re: ASK [reset-button]

Mon Jul 06, 2020 1:39 pm

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 ];
}
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1071
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: ASK [reset-button]

Mon Jul 06, 2020 4:29 pm

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;
}
 
User avatar
nichky
Forum Guru
Forum Guru
Topic Author
Posts: 1281
Joined: Tue Jun 23, 2015 2:35 pm

Re: ASK [reset-button]

Tue Jul 07, 2020 1:12 am

that i was looking for

Who is online

Users browsing this forum: DanMos79, jaclaz, lif2k3 and 137 guests