mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
hotspot-to-wpa: fail on missing context
This commit is contained in:
parent
a4354d762f
commit
2f399f2a48
1 changed files with 5 additions and 0 deletions
|
@ -16,6 +16,11 @@
|
||||||
|
|
||||||
:local MacAddress $"mac-address";
|
:local MacAddress $"mac-address";
|
||||||
:local UserName $username;
|
: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 Date [ /system/clock/get date ];
|
||||||
:local UserVal [ /ip/hotspot/user/get [ find where name=$UserName ] ];
|
:local UserVal [ /ip/hotspot/user/get [ find where name=$UserName ] ];
|
||||||
:local UserInfo [ $ParseKeyValueStore ($UserVal->"comment") ];
|
:local UserInfo [ $ParseKeyValueStore ($UserVal->"comment") ];
|
||||||
|
|
Loading…
Reference in a new issue