mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-07-05 07:34:32 +02:00
add scripts mode-button-{event,scheduler}
This commit is contained in:
parent
8f4986af0b
commit
172d789f2a
3 changed files with 38 additions and 0 deletions
14
mode-button-event
Normal file
14
mode-button-event
Normal file
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
# RouterOS script: mode-button-event
|
||||
# Copyright (c) 2018 Christian Hesse <mail@eworm.de>
|
||||
#
|
||||
# run on mode-button event and count button presses
|
||||
|
||||
:global "mode-button";
|
||||
|
||||
:set ($"mode-button"->"count") ($"mode-button"->"count" + 1);
|
||||
|
||||
:if ([ :len [ / system scheduler find where name="mode-button-scheduler" ] ] = 0) do={
|
||||
:log info "Creating mode-button scheduler...";
|
||||
/ system scheduler add name=mode-button-scheduler on-event=mode-button-scheduler interval=5s;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue