aboutsummaryrefslogtreecommitdiffstats
path: root/hotspot-to-wpa-cleanup
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-09-20 22:06:40 +0200
committerGravatar Christian Hesse <mail@eworm.de>2021-09-21 21:26:13 +0200
commit7952a6afac12028514584c6c0a81bffd481a9ae3 (patch)
treedeb28bb764adf2349a61fc07862156dd6aa15991 /hotspot-to-wpa-cleanup
parent9295d06fe2fce058b6b21d69ea6eac8282d23337 (diff)
hotspot-to-wpa-cleanup: match dhcp server name
... as we do not want the hotspot's lease to become static.
Diffstat (limited to 'hotspot-to-wpa-cleanup')
-rw-r--r--hotspot-to-wpa-cleanup7
1 files changed, 4 insertions, 3 deletions
diff --git a/hotspot-to-wpa-cleanup b/hotspot-to-wpa-cleanup
index 1321f83..d9bd3ec 100644
--- a/hotspot-to-wpa-cleanup
+++ b/hotspot-to-wpa-cleanup
@@ -19,7 +19,8 @@ $ScriptLock $0 false 10;
:foreach Client in=[ / caps-man registration-table find where comment~"^hotspot-to-wpa:" ] do={
:local ClientVal [ / caps-man registration-table get $Client ];
- :local Lease [ / ip dhcp-server lease find where mac-address=($ClientVal->"mac-address") dynamic ];
+ :local Lease [ / ip dhcp-server lease find where server~"wpa" dynamic \
+ mac-address=($ClientVal->"mac-address") ];
:if ([ :len $Lease ] > 0) do={
$LogPrintExit2 info $0 ("Client with mac address " . ($ClientVal->"mac-address") . \
" connected to WPA, making lease static.") false;
@@ -31,8 +32,8 @@ $ScriptLock $0 false 10;
:foreach Client in=[ / caps-man access-list find where comment~"^hotspot-to-wpa:" and \
!(comment~[ / system clock get date ]) ] do={
:local ClientVal [ / caps-man access-list get $Client ];
- :if ([ :len [ / ip dhcp-server lease find where mac-address=($ClientVal->"mac-address") \
- !dynamic ] ] = 0) do={
+ :if ([ :len [ / ip dhcp-server lease find where server~"wpa" !dynamic \
+ mac-address=($ClientVal->"mac-address") ] ] = 0) do={
$LogPrintExit2 info $0 ("Client with mac address " . ($ClientVal->"mac-address") . \
" did not connect to WPA, removing from access list.") false;
/ caps-man access-list remove $Client;