aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-06-23 17:33:51 +0200
committerGravatar Christian Hesse <mail@eworm.de>2023-06-28 11:04:13 +0200
commitf8a2b88692e21d46799738c13d4d12cfa95b4152 (patch)
tree326d8674c8daadfdd29f36e0110cfed58be876dd
parent5ba34c819a93e27b0eb4c56e25435fe522e16ee3 (diff)
hotspot-to-wpa: support non-local userschange-102
This has some limitations, though: The password is not known and additional configuration can not be given in user's comment.
-rw-r--r--doc/hotspot-to-wpa.md3
-rw-r--r--global-functions.rsc2
-rw-r--r--hotspot-to-wpa.rsc5
-rw-r--r--news-and-changes.rsc1
4 files changed, 9 insertions, 2 deletions
diff --git a/doc/hotspot-to-wpa.md b/doc/hotspot-to-wpa.md
index 0abe18b..097cba4 100644
--- a/doc/hotspot-to-wpa.md
+++ b/doc/hotspot-to-wpa.md
@@ -54,6 +54,9 @@ Create hotspot login credentials:
/ip/hotspot/user/add comment="Test User 1" name=user1 password=v3ry;
/ip/hotspot/user/add comment="Test User 2" name=user2 password=s3cr3t;
+This also works with authentication via radius, but is limited then:
+Additional information is not available, including the password.
+
Additionally templates can be created to give more options for access list:
* `action`: set to `reject` to ignore logins on that hotspot
diff --git a/global-functions.rsc b/global-functions.rsc
index 1f1cfa1..0378775 100644
--- a/global-functions.rsc
+++ b/global-functions.rsc
@@ -12,7 +12,7 @@
:local 0 "global-functions";
# expected configuration version
-:global ExpectedConfigVersion 101;
+:global ExpectedConfigVersion 102;
# global variables not to be changed by user
:global GlobalFunctionsReady false;
diff --git a/hotspot-to-wpa.rsc b/hotspot-to-wpa.rsc
index d7aeb65..ede4daf 100644
--- a/hotspot-to-wpa.rsc
+++ b/hotspot-to-wpa.rsc
@@ -25,7 +25,10 @@ $ScriptLock $0;
}
:local Date [ /system/clock/get date ];
-:local UserVal [ /ip/hotspot/user/get [ find where name=$UserName ] ];
+:local UserVal ({});
+:if ([ :len [ /ip/hotspot/user/find where name=$UserName ] ] > 0) do={
+ :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 ];
diff --git a/news-and-changes.rsc b/news-and-changes.rsc
index e33a7db..b062c5e 100644
--- a/news-and-changes.rsc
+++ b/news-and-changes.rsc
@@ -15,6 +15,7 @@
99="Modified 'dhcp-to-dns', which dropped global configuration. Settings moved to dhcp server's network definitions.";
100="The script 'ssh-keys-import' became a module 'mod/ssh-keys-import' with enhanced functionality.";
101="Introduced new script 'fw-addr-lists' to download, import and update firewall address-lists.";
+ 102="Modified 'hotspot-to-wpa' to support non-local (radius) users.";
};
# Migration steps to be applied on script updates