mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-08-01 14:11:35 +00:00
hotspot-to-wpa-lease: add extra verification for lease
This commit is contained in:
parent
fd50428e1f
commit
2d13c066f3
3 changed files with 12 additions and 0 deletions
|
|
@ -39,6 +39,10 @@
|
||||||
:local LeaseVal [ $ParseKeyValueStore [ /ip/dhcp-server/lease/get $Lease comment ] ];
|
:local LeaseVal [ $ParseKeyValueStore [ /ip/dhcp-server/lease/get $Lease comment ] ];
|
||||||
/ip/dhcp-server/lease/remove $Lease;
|
/ip/dhcp-server/lease/remove $Lease;
|
||||||
|
|
||||||
|
:if (($LeaseVal->"hotspot-to-wpa") != true) do={
|
||||||
|
:continue;
|
||||||
|
}
|
||||||
|
|
||||||
:local Date [ /system/clock/get date ];
|
:local Date [ /system/clock/get date ];
|
||||||
:local UserVal ({});
|
:local UserVal ({});
|
||||||
:if ([ :len [ /ip/hotspot/user/find where name=($LeaseVal->"username") ] ] > 0) do={
|
:if ([ :len [ /ip/hotspot/user/find where name=($LeaseVal->"username") ] ] > 0) do={
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,10 @@
|
||||||
:local LeaseVal [ $ParseKeyValueStore [ /ip/dhcp-server/lease/get $Lease comment ] ];
|
:local LeaseVal [ $ParseKeyValueStore [ /ip/dhcp-server/lease/get $Lease comment ] ];
|
||||||
/ip/dhcp-server/lease/remove $Lease;
|
/ip/dhcp-server/lease/remove $Lease;
|
||||||
|
|
||||||
|
:if (($LeaseVal->"hotspot-to-wpa") != true) do={
|
||||||
|
:continue;
|
||||||
|
}
|
||||||
|
|
||||||
:local Date [ /system/clock/get date ];
|
:local Date [ /system/clock/get date ];
|
||||||
:local UserVal ({});
|
:local UserVal ({});
|
||||||
:if ([ :len [ /ip/hotspot/user/find where name=($LeaseVal->"username") ] ] > 0) do={
|
:if ([ :len [ /ip/hotspot/user/find where name=($LeaseVal->"username") ] ] > 0) do={
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,10 @@
|
||||||
:local LeaseVal [ $ParseKeyValueStore [ /ip/dhcp-server/lease/get $Lease comment ] ];
|
:local LeaseVal [ $ParseKeyValueStore [ /ip/dhcp-server/lease/get $Lease comment ] ];
|
||||||
/ip/dhcp-server/lease/remove $Lease;
|
/ip/dhcp-server/lease/remove $Lease;
|
||||||
|
|
||||||
|
:if (($LeaseVal->"hotspot-to-wpa") != true) do={
|
||||||
|
:continue;
|
||||||
|
}
|
||||||
|
|
||||||
:local Date [ /system/clock/get date ];
|
:local Date [ /system/clock/get date ];
|
||||||
:local UserVal ({});
|
:local UserVal ({});
|
||||||
:if ([ :len [ /ip/hotspot/user/find where name=($LeaseVal->"username") ] ] > 0) do={
|
:if ([ :len [ /ip/hotspot/user/find where name=($LeaseVal->"username") ] ] > 0) do={
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue