aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-03-07 22:26:41 +0100
committerGravatar Christian Hesse <mail@eworm.de>2022-03-07 23:04:23 +0100
commitddb181fbc2d04d04743253b018cac00ffeb70de4 (patch)
tree441adc60e079ffa7e8e911eebf9c99db7804bbbb
parente25250e27be6884cfbf4276207b05561ed594b9b (diff)
hotspot-to-wpa: support ignoring specific hotspot
(cherry picked from commit c1fa0f3579573b75cadba585c1aeb7e68313645c)
-rw-r--r--doc/hotspot-to-wpa.md1
-rw-r--r--hotspot-to-wpa4
2 files changed, 5 insertions, 0 deletions
diff --git a/doc/hotspot-to-wpa.md b/doc/hotspot-to-wpa.md
index b410979..8733a7c 100644
--- a/doc/hotspot-to-wpa.md
+++ b/doc/hotspot-to-wpa.md
@@ -56,6 +56,7 @@ Create hotspot login credentials:
Additionally templates can be created to give more options for access list:
+* `action`: set to `reject` to ignore logins on that hotspot
* `private-passphrase`: do **not** use passphrase from hotspot's user
credentials, but given one - or unset (use default passphrase) with
special word `ignore`
diff --git a/hotspot-to-wpa b/hotspot-to-wpa
index b307a10..6290eda 100644
--- a/hotspot-to-wpa
+++ b/hotspot-to-wpa
@@ -23,6 +23,10 @@
:local Template [ / caps-man access-list get ([ find where disabled \
comment=("hotspot-to-wpa template " . $Hotspot) ]->0) ];
+:if ($Template->"action" = "reject") do={
+ $LogPrintExit2 info $0 ("Ignoring login for hotspot '" . $Hotspot . "'.") true;
+}
+
:if ([ :len [ / caps-man access-list find where comment="--- hotspot-to-wpa above ---" disabled ] ] = 0) do={
/ caps-man access-list add comment="--- hotspot-to-wpa above ---" disabled=yes;
$LogPrintExit2 warning $0 ("Added disabled access-list entry with comment '--- hotspot-to-wpa above ---'.") false;