aboutsummaryrefslogtreecommitdiffstats
path: root/daily-psk.local.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-10-16 21:15:05 +0200
committerGravatar Christian Hesse <mail@eworm.de>2023-10-17 14:05:03 +0200
commit0e83d2e317288442de06e6aea16aaaf0f7654f08 (patch)
tree6cc47226c511f85cf23229f0c0a8737e35c72096 /daily-psk.local.rsc
parent286e3d9cf907984a6e9886eda40dc7958845b93d (diff)
daily-psk: use named array
Diffstat (limited to 'daily-psk.local.rsc')
-rw-r--r--daily-psk.local.rsc13
1 files changed, 4 insertions, 9 deletions
diff --git a/daily-psk.local.rsc b/daily-psk.local.rsc
index df6d962..523e026 100644
--- a/daily-psk.local.rsc
+++ b/daily-psk.local.rsc
@@ -65,15 +65,9 @@ $WaitFullyConnected;
/interface/wireless/access-list/set $AccList private-pre-shared-key=$NewPsk;
:if ([ :len [ /interface/wireless/find where name=$IntName !disabled ] ] = 1) do={
- :foreach SeenSsid in=$Seen do={
- :if ($SeenSsid = $Ssid) do={
- $LogPrintExit2 debug $0 ("Already sent a mail for SSID " . $Ssid . ", skipping.") false;
- :set Skip 1;
- }
- }
-
- :if ($Skip = 0) do={
- :set Seen ($Seen, $Ssid);
+ :if ($Seen->$Ssid = 1) do={
+ $LogPrintExit2 debug $0 ("Already sent a mail for SSID " . $Ssid . ", skipping.") false;
+ } else={
:local Link ($DailyPskQrCodeUrl . \
"?scale=8&level=1&ssid=" . [ $UrlEncode $Ssid ] . "&pass=" . [ $UrlEncode $NewPsk ]);
$SendNotification2 ({ origin=$0; \
@@ -83,6 +77,7 @@ $WaitFullyConnected;
[ $FormatLine "PSK" $NewPsk ] . "\n" . \
[ $FormatLine "Date" $Date ] . "\n\n" . \
"A client device specific rule must not exist!"); link=$Link });
+ :set ($Seen->$Ssid) 1;
}
}
}