mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
lease-script: drop differentiation of assign / deassign...
... not that we have early locking.
This commit is contained in:
parent
9509371690
commit
8e2c783068
9 changed files with 12 additions and 15 deletions
|
@ -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!
|
||||
|
||||
|
|
|
@ -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!
|
||||
|
||||
|
|
|
@ -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'!
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,10 +41,8 @@ $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;
|
||||
}
|
||||
}
|
||||
|
||||
:foreach Order,Script in=$RunOrder do={
|
||||
:do {
|
||||
|
|
Loading…
Reference in a new issue