hotspot-to-wpa: use $LogPrintExit and add more logging

This commit is contained in:
Christian Hesse 2020-03-05 09:17:19 +01:00
parent 970641a974
commit e104b54bf0

View file

@ -4,6 +4,8 @@
#
# add private WPA passphrase after hotspot login
:global LogPrintExit;
:local MacAddress $"mac-address";
:local UserName $username;
:local Date [ / system clock get date ];
@ -11,10 +13,13 @@
:if ([ / caps-man access-list print count-only where comment="--- hotspot-to-wpa above ---" disabled ] = 0) do={
/ caps-man access-list add comment="--- hotspot-to-wpa above ---" disabled;
log warn "Added disabled access-list entry with comment '--- hotspot-to-wpa above ---'.";
$LogPrintExit warning "Added disabled access-list entry with comment '--- hotspot-to-wpa above ---'." false;
}
:local PlaceBefore [ / caps-man access-list find where comment="--- hotspot-to-wpa above ---" disabled ];
$LogPrintExit info ("Adding/updating accesslist entry for mac address " . $MacAddress . \
" (user " . $UserName . ").") false;
/ caps-man access-list remove [ find where mac-address=$MacAddress comment~"^hotspot-to-wpa: " ];
:local Limits [ / caps-man access-list get $PlaceBefore ];