From 172d789f2a4f350555665173f53f6cd5122cd1a7 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 10 Sep 2018 22:15:54 +0200 Subject: add scripts mode-button-{event,scheduler} --- mode-button-event | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 mode-button-event (limited to 'mode-button-event') diff --git a/mode-button-event b/mode-button-event new file mode 100644 index 0000000..2306e1e --- /dev/null +++ b/mode-button-event @@ -0,0 +1,14 @@ +# +# RouterOS script: mode-button-event +# Copyright (c) 2018 Christian Hesse +# +# 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; +} -- cgit v1.2.3-70-g09d2