hotspot-to-wpa: support non-local users

This has some limitations, though: The password is not known and
additional configuration can not be given in user's comment.
This commit is contained in:
Christian Hesse 2023-06-23 17:33:51 +02:00
parent 5ba34c819a
commit f8a2b88692
4 changed files with 9 additions and 2 deletions

View file

@ -25,7 +25,10 @@ $ScriptLock $0;
}
:local Date [ /system/clock/get date ];
:local UserVal [ /ip/hotspot/user/get [ find where name=$UserName ] ];
:local UserVal ({});
:if ([ :len [ /ip/hotspot/user/find where name=$UserName ] ] > 0) do={
:set UserVal [ /ip/hotspot/user/get [ find where name=$UserName ] ];
}
:local UserInfo [ $ParseKeyValueStore ($UserVal->"comment") ];
:local Hotspot [ /ip/hotspot/host/get [ find where mac-address=$MacAddress authorized ] server ];