hotspot-to-wpa-cleanup: prepare real timeout value in variable...

... to make sure it is not re-calculated for every single lease.
This commit is contained in:
Christian Hesse 2024-11-13 08:57:05 +01:00
parent ae655646ba
commit e5c3aeb5cd
3 changed files with 6 additions and 6 deletions

View file

@ -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.");

View file

@ -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.");

View file

@ -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.");