hotspot-to-wpa: create template if missing

This commit is contained in:
Christian Hesse 2022-04-26 14:21:28 +02:00
parent c132d28408
commit 3f8d3acd60

View file

@ -27,8 +27,13 @@
}
:local PlaceBefore ([ / caps-man access-list find where comment="--- hotspot-to-wpa above ---" disabled ]->0);
:local Template [ / caps-man access-list get ([ find where disabled \
comment=("hotspot-to-wpa template " . $Hotspot) ]->0) ];
: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;
$LogPrintExit2 warning $0 ("Added template in access-list for hotspot '" . $Hotspot . "'.") false;
}
:local Template [ / caps-man access-list get ([ find where \
comment=("hotspot-to-wpa template " . $Hotspot) disabled ]->0) ];
:if ($Template->"action" = "reject") do={
$LogPrintExit2 info $0 ("Ignoring login for hotspot '" . $Hotspot . "'.") true;