aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-04-26 14:21:28 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-04-26 14:26:17 +0200
commit3f8d3acd60dab580c590a5a5e87f65cdcceb3433 (patch)
tree1408a243d2c19cf71703023b12fc9bbc3ff2fc40
parentc132d2840843a5da40f30e5b66cb1495f5c02357 (diff)
hotspot-to-wpa: create template if missing
-rw-r--r--hotspot-to-wpa9
1 files changed, 7 insertions, 2 deletions
diff --git a/hotspot-to-wpa b/hotspot-to-wpa
index 9ffee91..628d748 100644
--- a/hotspot-to-wpa
+++ b/hotspot-to-wpa
@@ -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;