hotspot-to-wpa: fail on missing context

This commit is contained in:
Christian Hesse 2023-06-11 22:52:10 +02:00
parent a4354d762f
commit 2f399f2a48

View file

@ -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") ];