aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-06-11 22:52:10 +0200
committerGravatar Christian Hesse <mail@eworm.de>2023-06-11 23:03:17 +0200
commit2f399f2a48a063d3164e8b9428bb78b6375e2661 (patch)
tree7d06c180ef621a3a5fdb47d222c076387435a3a6
parenta4354d762f6b2fa8959124307a2eb841d5b00391 (diff)
hotspot-to-wpa: fail on missing context
-rw-r--r--hotspot-to-wpa.rsc5
1 files changed, 5 insertions, 0 deletions
diff --git a/hotspot-to-wpa.rsc b/hotspot-to-wpa.rsc
index dbce9ff..e2de112 100644
--- a/hotspot-to-wpa.rsc
+++ b/hotspot-to-wpa.rsc
@@ -16,6 +16,11 @@
:local MacAddress $"mac-address";
:local UserName $username;
+
+:if ([ :typeof $MacAddress ] = "nothing" || [ :typeof $UserName ] = "nothing") do={
+ $LogPrintExit2 error $0 ("This script is supposed to run from hotspot on login.") true;
+}
+
:local Date [ /system/clock/get date ];
:local UserVal [ /ip/hotspot/user/get [ find where name=$UserName ] ];
:local UserInfo [ $ParseKeyValueStore ($UserVal->"comment") ];