mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-08-01 14:11:35 +00:00
FIXUP
This commit is contained in:
parent
8678792837
commit
f2bffb1c68
6 changed files with 25 additions and 19 deletions
|
|
@ -37,6 +37,7 @@
|
|||
|
||||
:foreach Lease in=[ /ip/dhcp-server/lease/find where !dynamic disabled comment~"\\bhotspot-to-wpa\\b" ] do={
|
||||
:local LeaseVal [ $ParseKeyValueStore [ /ip/dhcp-server/lease/get $Lease comment ] ];
|
||||
/ip/dhcp-server/lease/remove $Lease;
|
||||
|
||||
:if (($LeaseVal->"hotspot-to-wpa") != true) do={
|
||||
:continue;
|
||||
|
|
@ -51,16 +52,14 @@
|
|||
:set UserVal [ /ip/hotspot/user/get [ find where name=$UserName ] ];
|
||||
}
|
||||
:local UserInfo [ $ParseKeyValueStore ($UserVal->"comment") ];
|
||||
:local Hotspot [ /ip/hotspot/host/get [ find where mac-address=$MacAddress authorized ] server ];
|
||||
/ip/dhcp-server/lease/remove $Lease;
|
||||
|
||||
:if ([ :len [ /caps-man/access-list/find where \
|
||||
comment=("hotspot-to-wpa template " . $Hotspot) disabled ] ] = 0) do={
|
||||
/caps-man/access-list/add comment=("hotspot-to-wpa template " . $Hotspot) disabled=yes place-before=$PlaceBefore;
|
||||
$LogPrint warning $ScriptName ("Added template in access-list for hotspot '" . $Hotspot . "'.");
|
||||
comment=("hotspot-to-wpa template " . $LeaseVal->"hotspot") disabled ] ] = 0) do={
|
||||
/caps-man/access-list/add comment=("hotspot-to-wpa template " . $LeaseVal->"hotspot") disabled=yes place-before=$PlaceBefore;
|
||||
$LogPrint warning $ScriptName ("Added template in access-list for hotspot '" . $LeaseVal->"hotspot" . "'.");
|
||||
}
|
||||
:local Template [ /caps-man/access-list/get ([ find where \
|
||||
comment=("hotspot-to-wpa template " . $Hotspot) disabled ]->0) ];
|
||||
comment=("hotspot-to-wpa template " . $LeaseVal->"hotspot") disabled ]->0) ];
|
||||
|
||||
$LogPrint info $ScriptName ("Adding/updating access-list entry for mac address " . $MacAddress . \
|
||||
" (user " . $UserName . ").");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue