aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-07-15 12:47:05 +0200
committerGravatar Christian Hesse <mail@eworm.de>2021-07-15 12:47:05 +0200
commit8e2c783068829c523c3b8fa8835f77f3a6ef56e0 (patch)
tree5b34965f7735ed276ff2f3991d5eb1eae54de589
parent9509371690c26bb67918448458f7b2989df4635c (diff)
lease-script: drop differentiation of assign / deassign...
... not that we have early locking.
-rw-r--r--collect-wireless-mac.capsman2
-rw-r--r--collect-wireless-mac.local2
-rw-r--r--collect-wireless-mac.template2
-rw-r--r--dhcp-lease-comment.capsman2
-rw-r--r--dhcp-lease-comment.local2
-rw-r--r--dhcp-lease-comment.template2
-rw-r--r--dhcp-to-dns2
-rw-r--r--hotspot-to-wpa-cleanup2
-rw-r--r--lease-script11
9 files changed, 12 insertions, 15 deletions
diff --git a/collect-wireless-mac.capsman b/collect-wireless-mac.capsman
index 5f6d750..34e022d 100644
--- a/collect-wireless-mac.capsman
+++ b/collect-wireless-mac.capsman
@@ -6,7 +6,7 @@
# collect wireless mac adresses in access list
# https://git.eworm.de/cgit/routeros-scripts/about/doc/collect-wireless-mac.md
#
-# provides: lease-script, assign, order=40
+# provides: lease-script, order=40
#
# !! Do not edit this file, it is generated from template!
diff --git a/collect-wireless-mac.local b/collect-wireless-mac.local
index a2bcf5b..2149dd6 100644
--- a/collect-wireless-mac.local
+++ b/collect-wireless-mac.local
@@ -6,7 +6,7 @@
# collect wireless mac adresses in access list
# https://git.eworm.de/cgit/routeros-scripts/about/doc/collect-wireless-mac.md
#
-# provides: lease-script, assign, order=40
+# provides: lease-script, order=40
#
# !! Do not edit this file, it is generated from template!
diff --git a/collect-wireless-mac.template b/collect-wireless-mac.template
index 7b6848b..7bb84dd 100644
--- a/collect-wireless-mac.template
+++ b/collect-wireless-mac.template
@@ -6,7 +6,7 @@
# collect wireless mac adresses in access list
# https://git.eworm.de/cgit/routeros-scripts/about/doc/collect-wireless-mac.md
#
-# provides: lease-script, assign, order=40
+# provides: lease-script, order=40
#
# !! This is just a template! Replace '%PATH%' with 'caps-man'
# !! or 'interface wireless'!
diff --git a/dhcp-lease-comment.capsman b/dhcp-lease-comment.capsman
index 33c1b6a..83a9d79 100644
--- a/dhcp-lease-comment.capsman
+++ b/dhcp-lease-comment.capsman
@@ -3,7 +3,7 @@
# Copyright (c) 2013-2021 Christian Hesse <mail@eworm.de>
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
#
-# provides: lease-script, assign, order=60
+# provides: lease-script, order=60
#
# update dhcp-server lease comment with infos from access-list
# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-lease-comment.md
diff --git a/dhcp-lease-comment.local b/dhcp-lease-comment.local
index b05754d..eb4b915 100644
--- a/dhcp-lease-comment.local
+++ b/dhcp-lease-comment.local
@@ -3,7 +3,7 @@
# Copyright (c) 2013-2021 Christian Hesse <mail@eworm.de>
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
#
-# provides: lease-script, assign, order=60
+# provides: lease-script, order=60
#
# update dhcp-server lease comment with infos from access-list
# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-lease-comment.md
diff --git a/dhcp-lease-comment.template b/dhcp-lease-comment.template
index 04a6261..2f070b4 100644
--- a/dhcp-lease-comment.template
+++ b/dhcp-lease-comment.template
@@ -3,7 +3,7 @@
# Copyright (c) 2013-2021 Christian Hesse <mail@eworm.de>
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
#
-# provides: lease-script, assign, order=60
+# provides: lease-script, order=60
#
# update dhcp-server lease comment with infos from access-list
# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-lease-comment.md
diff --git a/dhcp-to-dns b/dhcp-to-dns
index 44fd673..8afbf54 100644
--- a/dhcp-to-dns
+++ b/dhcp-to-dns
@@ -3,7 +3,7 @@
# Copyright (c) 2013-2021 Christian Hesse <mail@eworm.de>
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
#
-# provides: lease-script, assign, deassign, order=20
+# provides: lease-script, order=20
#
# check DHCP leases and add/remove/update DNS entries
# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-to-dns.md
diff --git a/hotspot-to-wpa-cleanup b/hotspot-to-wpa-cleanup
index c29aa7c..1321f83 100644
--- a/hotspot-to-wpa-cleanup
+++ b/hotspot-to-wpa-cleanup
@@ -3,7 +3,7 @@
# Copyright (c) 2021 Christian Hesse <mail@eworm.de>
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
#
-# provides: lease-script, assign, order=80
+# provides: lease-script, order=80
#
# manage and clean up private WPA passphrase after hotspot login
# https://git.eworm.de/cgit/routeros-scripts/about/doc/hotspot-to-wpa.md
diff --git a/lease-script b/lease-script
index 3134cb6..6de6fd9 100644
--- a/lease-script
+++ b/lease-script
@@ -28,11 +28,10 @@ $ScriptLock $0 false 10;
$LogPrintExit2 debug $0 ("More invocations are waiting, exiting early.") true;
}
-:local State ([ $IfThenElse ($leaseBound = 0) "de" "" ] . "assign");
-:local RunOrder [ :toarray "" ];
+$LogPrintExit2 debug $0 ("DHCP Server " . $leaseServerName . " " . [ $IfThenElse ($leaseBound = 0) \
+ "de" "" ] . "assigned lease " . $leaseActIP . " to " . $leaseActMAC) false;
-$LogPrintExit2 debug $0 ("DHCP Server " . $leaseServerName . " " . \
- $State . "ed lease " . $leaseActIP . " to " . $leaseActMAC) false;
+:local RunOrder [ :toarray "" ];
:foreach Script in=[ / system script find where source~("\n# provides: lease-script, ") ] do={
:local Name [ / system script get $Script name ];
@@ -42,9 +41,7 @@ $LogPrintExit2 debug $0 ("DHCP Server " . $leaseServerName . " " . \
:set Store [ :pick $Store 0 [ :find $Store "\n" ] ];
:set Store [ $ParseKeyValueStore $Store ];
- :if (($Store->$State) = true) do={
- :set ($RunOrder->($Store->"order")) $Name;
- }
+ :set ($RunOrder->($Store->"order")) $Name;
}
:foreach Order,Script in=$RunOrder do={