aboutsummaryrefslogtreecommitdiffstats
path: root/mode-button-scheduler
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2018-09-10 22:15:54 +0200
committerGravatar Christian Hesse <mail@eworm.de>2018-09-10 22:15:54 +0200
commit172d789f2a4f350555665173f53f6cd5122cd1a7 (patch)
treefe7cd5f64346631c9f2bbc3e9ffd40c646b8faa1 /mode-button-scheduler
parent8f4986af0bb0ecea13594b9ea2bbcfbaa6c8a7e7 (diff)
add scripts mode-button-{event,scheduler}
Diffstat (limited to 'mode-button-scheduler')
-rw-r--r--mode-button-scheduler16
1 files changed, 16 insertions, 0 deletions
diff --git a/mode-button-scheduler b/mode-button-scheduler
new file mode 100644
index 0000000..bf85826
--- /dev/null
+++ b/mode-button-scheduler
@@ -0,0 +1,16 @@
+#
+# RouterOS script: mode-button-scheduler
+# Copyright (c) 2018 Christian Hesse <mail@eworm.de>
+#
+# act on multiple mode-botton presses from scheduler
+
+:global "mode-button";
+
+:local count ($"mode-button"->"count");
+:local action [ :parse ($"mode-button"->[ :tostr $count ]) ];
+
+:set ($"mode-button"->"count") 0;
+/ system scheduler remove mode-button-scheduler;
+
+:log info ("Acting on " . $count . " mode-button presses.");
+$action;