mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
hotspot-to-wpa-cleanup: match dhcp server name
... as we do not want the hotspot's lease to become static.
This commit is contained in:
parent
9295d06fe2
commit
7952a6afac
1 changed files with 4 additions and 3 deletions
|
@ -19,7 +19,8 @@ $ScriptLock $0 false 10;
|
||||||
|
|
||||||
:foreach Client in=[ / caps-man registration-table find where comment~"^hotspot-to-wpa:" ] do={
|
:foreach Client in=[ / caps-man registration-table find where comment~"^hotspot-to-wpa:" ] do={
|
||||||
:local ClientVal [ / caps-man registration-table get $Client ];
|
: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={
|
:if ([ :len $Lease ] > 0) do={
|
||||||
$LogPrintExit2 info $0 ("Client with mac address " . ($ClientVal->"mac-address") . \
|
$LogPrintExit2 info $0 ("Client with mac address " . ($ClientVal->"mac-address") . \
|
||||||
" connected to WPA, making lease static.") false;
|
" 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 \
|
:foreach Client in=[ / caps-man access-list find where comment~"^hotspot-to-wpa:" and \
|
||||||
!(comment~[ / system clock get date ]) ] do={
|
!(comment~[ / system clock get date ]) ] do={
|
||||||
:local ClientVal [ / caps-man access-list get $Client ];
|
:local ClientVal [ / caps-man access-list get $Client ];
|
||||||
:if ([ :len [ / ip dhcp-server lease find where mac-address=($ClientVal->"mac-address") \
|
:if ([ :len [ / ip dhcp-server lease find where server~"wpa" !dynamic \
|
||||||
!dynamic ] ] = 0) do={
|
mac-address=($ClientVal->"mac-address") ] ] = 0) do={
|
||||||
$LogPrintExit2 info $0 ("Client with mac address " . ($ClientVal->"mac-address") . \
|
$LogPrintExit2 info $0 ("Client with mac address " . ($ClientVal->"mac-address") . \
|
||||||
" did not connect to WPA, removing from access list.") false;
|
" did not connect to WPA, removing from access list.") false;
|
||||||
/ caps-man access-list remove $Client;
|
/ caps-man access-list remove $Client;
|
||||||
|
|
Loading…
Reference in a new issue