mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-07-27 06:14:48 +02: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…
Add table
Add a link
Reference in a new issue