From 8678792837a8b5d4c5f5a57acf875109c9283198 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 31 Jul 2026 21:47:46 +0200 Subject: [PATCH] FIXUP --- hotspot-to-wpa-lease.capsman.rsc | 4 ++-- hotspot-to-wpa-lease.template.rsc | 4 ++-- hotspot-to-wpa-lease.wifi.rsc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hotspot-to-wpa-lease.capsman.rsc b/hotspot-to-wpa-lease.capsman.rsc index 89ab7ae4..2533e12d 100644 --- a/hotspot-to-wpa-lease.capsman.rsc +++ b/hotspot-to-wpa-lease.capsman.rsc @@ -37,7 +37,6 @@ :foreach Lease in=[ /ip/dhcp-server/lease/find where !dynamic disabled comment~"\\bhotspot-to-wpa\\b" ] do={ :local LeaseVal [ $ParseKeyValueStore [ /ip/dhcp-server/lease/get $Lease comment ] ]; - /ip/dhcp-server/lease/remove $Lease; :if (($LeaseVal->"hotspot-to-wpa") != true) do={ :continue; @@ -52,7 +51,8 @@ :set UserVal [ /ip/hotspot/user/get [ find where name=$UserName ] ]; } :local UserInfo [ $ParseKeyValueStore ($UserVal->"comment") ]; - :local Hotspot [ /ip/hotspot/host/get [ find where mac-address=$MacAddress ] server ]; + :local Hotspot [ /ip/hotspot/host/get [ find where mac-address=$MacAddress authorized ] server ]; + /ip/dhcp-server/lease/remove $Lease; :if ([ :len [ /caps-man/access-list/find where \ comment=("hotspot-to-wpa template " . $Hotspot) disabled ] ] = 0) do={ diff --git a/hotspot-to-wpa-lease.template.rsc b/hotspot-to-wpa-lease.template.rsc index 67e71fe6..348f3726 100644 --- a/hotspot-to-wpa-lease.template.rsc +++ b/hotspot-to-wpa-lease.template.rsc @@ -41,7 +41,6 @@ :foreach Lease in=[ /ip/dhcp-server/lease/find where !dynamic disabled comment~"\\bhotspot-to-wpa\\b" ] do={ :local LeaseVal [ $ParseKeyValueStore [ /ip/dhcp-server/lease/get $Lease comment ] ]; - /ip/dhcp-server/lease/remove $Lease; :if (($LeaseVal->"hotspot-to-wpa") != true) do={ :continue; @@ -56,7 +55,8 @@ :set UserVal [ /ip/hotspot/user/get [ find where name=$UserName ] ]; } :local UserInfo [ $ParseKeyValueStore ($UserVal->"comment") ]; - :local Hotspot [ /ip/hotspot/host/get [ find where mac-address=$MacAddress ] server ]; + :local Hotspot [ /ip/hotspot/host/get [ find where mac-address=$MacAddress authorized ] server ]; + /ip/dhcp-server/lease/remove $Lease; :if ([ :len [ /caps-man/access-list/find where \ :if ([ :len [ /interface/wifi/access-list/find where \ diff --git a/hotspot-to-wpa-lease.wifi.rsc b/hotspot-to-wpa-lease.wifi.rsc index 78ae2442..2a90c06a 100644 --- a/hotspot-to-wpa-lease.wifi.rsc +++ b/hotspot-to-wpa-lease.wifi.rsc @@ -37,7 +37,6 @@ :foreach Lease in=[ /ip/dhcp-server/lease/find where !dynamic disabled comment~"\\bhotspot-to-wpa\\b" ] do={ :local LeaseVal [ $ParseKeyValueStore [ /ip/dhcp-server/lease/get $Lease comment ] ]; - /ip/dhcp-server/lease/remove $Lease; :if (($LeaseVal->"hotspot-to-wpa") != true) do={ :continue; @@ -52,7 +51,8 @@ :set UserVal [ /ip/hotspot/user/get [ find where name=$UserName ] ]; } :local UserInfo [ $ParseKeyValueStore ($UserVal->"comment") ]; - :local Hotspot [ /ip/hotspot/host/get [ find where mac-address=$MacAddress ] server ]; + :local Hotspot [ /ip/hotspot/host/get [ find where mac-address=$MacAddress authorized ] server ]; + /ip/dhcp-server/lease/remove $Lease; :if ([ :len [ /interface/wifi/access-list/find where \ comment=("hotspot-to-wpa template " . $Hotspot) disabled ] ] = 0) do={