Community discussions

MikroTik App
 
User avatar
nichky
Long time Member
Long time Member
Topic Author
Posts: 604
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 ?
Nikola Suminoski
MikroTik Consultan
MTCRE l MTCWE

!) Safe Mode is your friend;
 
User avatar
eworm
Long time Member
Long time Member
Posts: 603
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
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
Zacharias
Forum Guru
Forum Guru
Posts: 2309
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
Long time Member
Long time Member
Posts: 603
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.
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
User avatar
nichky
Long time Member
Long time Member
Topic Author
Posts: 604
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?
Nikola Suminoski
MikroTik Consultan
MTCRE l MTCWE

!) Safe Mode is your friend;
 
User avatar
eworm
Long time Member
Long time Member
Posts: 603
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.
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
User avatar
nichky
Long time Member
Long time Member
Topic Author
Posts: 604
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 ];
}
Nikola Suminoski
MikroTik Consultan
MTCRE l MTCWE

!) Safe Mode is your friend;
 
User avatar
eworm
Long time Member
Long time Member
Posts: 603
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;
}
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts

Who is online

Users browsing this forum: Baidu [Spider], CZFan, Google [Bot], keithy, knowledgemonster and 81 guests