diff options
author | Christian Hesse <mail@eworm.de> | 2024-11-13 08:57:05 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-11-13 08:57:05 +0100 |
commit | e5c3aeb5cd314119dd7b062e43d65fdff7371051 (patch) | |
tree | 5f597c439f58eb7e7553e58c9c9d7b119f7fe668 | |
parent | ae655646ba21cdf4638e6001a49c9d3cf849bc08 (diff) |
hotspot-to-wpa-cleanup: prepare real timeout value in variable...
... to make sure it is not re-calculated for every single lease.
-rw-r--r-- | hotspot-to-wpa-cleanup.capsman.rsc | 4 | ||||
-rw-r--r-- | hotspot-to-wpa-cleanup.template.rsc | 4 | ||||
-rw-r--r-- | hotspot-to-wpa-cleanup.wifi.rsc | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/hotspot-to-wpa-cleanup.capsman.rsc b/hotspot-to-wpa-cleanup.capsman.rsc index 674a480..d429904 100644 --- a/hotspot-to-wpa-cleanup.capsman.rsc +++ b/hotspot-to-wpa-cleanup.capsman.rsc @@ -61,9 +61,9 @@ } :foreach Server,Timeout in=$DHCPServers do={ + :local TimeoutExtra ($Timeout + [ /system/clock/get time ]); :foreach Lease in=[ /ip/dhcp-server/lease/find where !dynamic status="waiting" \ - server=$Server last-seen>($Timeout + [ /system/clock/get time ]) \ - comment~"^hotspot-to-wpa:" ] do={ + server=$Server last-seen>$TimeoutExtra comment~"^hotspot-to-wpa:" ] do={ :local LeaseVal [ /ip/dhcp-server/lease/get $Lease ]; $LogPrint info $ScriptName ("Client with mac address " . ($LeaseVal->"mac-address") . \ " was not seen for " . $Timeout . ", removing."); diff --git a/hotspot-to-wpa-cleanup.template.rsc b/hotspot-to-wpa-cleanup.template.rsc index 88c307b..726bc74 100644 --- a/hotspot-to-wpa-cleanup.template.rsc +++ b/hotspot-to-wpa-cleanup.template.rsc @@ -67,9 +67,9 @@ } :foreach Server,Timeout in=$DHCPServers do={ + :local TimeoutExtra ($Timeout + [ /system/clock/get time ]); :foreach Lease in=[ /ip/dhcp-server/lease/find where !dynamic status="waiting" \ - server=$Server last-seen>($Timeout + [ /system/clock/get time ]) \ - comment~"^hotspot-to-wpa:" ] do={ + server=$Server last-seen>$TimeoutExtra comment~"^hotspot-to-wpa:" ] do={ :local LeaseVal [ /ip/dhcp-server/lease/get $Lease ]; $LogPrint info $ScriptName ("Client with mac address " . ($LeaseVal->"mac-address") . \ " was not seen for " . $Timeout . ", removing."); diff --git a/hotspot-to-wpa-cleanup.wifi.rsc b/hotspot-to-wpa-cleanup.wifi.rsc index b73f1a9..32ae565 100644 --- a/hotspot-to-wpa-cleanup.wifi.rsc +++ b/hotspot-to-wpa-cleanup.wifi.rsc @@ -61,9 +61,9 @@ } :foreach Server,Timeout in=$DHCPServers do={ + :local TimeoutExtra ($Timeout + [ /system/clock/get time ]); :foreach Lease in=[ /ip/dhcp-server/lease/find where !dynamic status="waiting" \ - server=$Server last-seen>($Timeout + [ /system/clock/get time ]) \ - comment~"^hotspot-to-wpa:" ] do={ + server=$Server last-seen>$TimeoutExtra comment~"^hotspot-to-wpa:" ] do={ :local LeaseVal [ /ip/dhcp-server/lease/get $Lease ]; $LogPrint info $ScriptName ("Client with mac address " . ($LeaseVal->"mac-address") . \ " was not seen for " . $Timeout . ", removing."); |