aboutsummaryrefslogtreecommitdiffstats
path: root/mode-button-scheduler
diff options
context:
space:
mode:
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;