mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-31 16:24:25 +02:00
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:
parent
ae655646ba
commit
e5c3aeb5cd
3 changed files with 6 additions and 6 deletions
|
@ -61,9 +61,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
:foreach Server,Timeout in=$DHCPServers do={
|
: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" \
|
:foreach Lease in=[ /ip/dhcp-server/lease/find where !dynamic status="waiting" \
|
||||||
server=$Server last-seen>($Timeout + [ /system/clock/get time ]) \
|
server=$Server last-seen>$TimeoutExtra comment~"^hotspot-to-wpa:" ] do={
|
||||||
comment~"^hotspot-to-wpa:" ] do={
|
|
||||||
:local LeaseVal [ /ip/dhcp-server/lease/get $Lease ];
|
:local LeaseVal [ /ip/dhcp-server/lease/get $Lease ];
|
||||||
$LogPrint info $ScriptName ("Client with mac address " . ($LeaseVal->"mac-address") . \
|
$LogPrint info $ScriptName ("Client with mac address " . ($LeaseVal->"mac-address") . \
|
||||||
" was not seen for " . $Timeout . ", removing.");
|
" was not seen for " . $Timeout . ", removing.");
|
||||||
|
|
|
@ -67,9 +67,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
:foreach Server,Timeout in=$DHCPServers do={
|
: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" \
|
:foreach Lease in=[ /ip/dhcp-server/lease/find where !dynamic status="waiting" \
|
||||||
server=$Server last-seen>($Timeout + [ /system/clock/get time ]) \
|
server=$Server last-seen>$TimeoutExtra comment~"^hotspot-to-wpa:" ] do={
|
||||||
comment~"^hotspot-to-wpa:" ] do={
|
|
||||||
:local LeaseVal [ /ip/dhcp-server/lease/get $Lease ];
|
:local LeaseVal [ /ip/dhcp-server/lease/get $Lease ];
|
||||||
$LogPrint info $ScriptName ("Client with mac address " . ($LeaseVal->"mac-address") . \
|
$LogPrint info $ScriptName ("Client with mac address " . ($LeaseVal->"mac-address") . \
|
||||||
" was not seen for " . $Timeout . ", removing.");
|
" was not seen for " . $Timeout . ", removing.");
|
||||||
|
|
|
@ -61,9 +61,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
:foreach Server,Timeout in=$DHCPServers do={
|
: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" \
|
:foreach Lease in=[ /ip/dhcp-server/lease/find where !dynamic status="waiting" \
|
||||||
server=$Server last-seen>($Timeout + [ /system/clock/get time ]) \
|
server=$Server last-seen>$TimeoutExtra comment~"^hotspot-to-wpa:" ] do={
|
||||||
comment~"^hotspot-to-wpa:" ] do={
|
|
||||||
:local LeaseVal [ /ip/dhcp-server/lease/get $Lease ];
|
:local LeaseVal [ /ip/dhcp-server/lease/get $Lease ];
|
||||||
$LogPrint info $ScriptName ("Client with mac address " . ($LeaseVal->"mac-address") . \
|
$LogPrint info $ScriptName ("Client with mac address " . ($LeaseVal->"mac-address") . \
|
||||||
" was not seen for " . $Timeout . ", removing.");
|
" was not seen for " . $Timeout . ", removing.");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue