From 7952a6afac12028514584c6c0a81bffd481a9ae3 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 20 Sep 2021 22:06:40 +0200 Subject: hotspot-to-wpa-cleanup: match dhcp server name ... as we do not want the hotspot's lease to become static. --- hotspot-to-wpa-cleanup | 7 ++++--- 1 file 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; -- cgit v1.2.3-54-g00ecf