From 0e83d2e317288442de06e6aea16aaaf0f7654f08 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 16 Oct 2023 21:15:05 +0200 Subject: daily-psk: use named array --- daily-psk.template.rsc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'daily-psk.template.rsc') diff --git a/daily-psk.template.rsc b/daily-psk.template.rsc index 125e6c5..ad9198a 100644 --- a/daily-psk.template.rsc +++ b/daily-psk.template.rsc @@ -81,15 +81,9 @@ $WaitFullyConnected; :if ([ :len [ /caps-man/actual-interface-configuration/find where configuration.ssid=$Ssid !disabled ] ] > 0) do={ :if ([ :len [ /interface/wifiwave2/actual-configuration/find where configuration.ssid=$Ssid ] ] > 0) do={ :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; \ @@ -99,6 +93,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; } } } -- cgit v1.2.3-54-g00ecf