From 2f399f2a48a063d3164e8b9428bb78b6375e2661 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sun, 11 Jun 2023 22:52:10 +0200 Subject: hotspot-to-wpa: fail on missing context --- hotspot-to-wpa.rsc | 5 +++++ 1 file changed, 5 insertions(+) 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") ]; -- cgit v1.2.3-54-g00ecf