mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
daily-psk: use $LogPrintExit
This commit is contained in:
parent
1dbd91f76d
commit
3127800496
3 changed files with 11 additions and 8 deletions
|
@ -7,9 +7,10 @@
|
|||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global Identity;
|
||||
:global DailyPskMatchComment;
|
||||
:global Identity;
|
||||
|
||||
:global LogPrintExit;
|
||||
:global SendNotification;
|
||||
:global UrlEncode;
|
||||
:global WaitForFile;
|
||||
|
@ -56,13 +57,13 @@
|
|||
:local Skip 0;
|
||||
|
||||
:if ($NewPsk != $OldPsk) do={
|
||||
:log info ("Updating daily PSK for " . $Ssid . " to " . $NewPsk . " (was " . $OldPsk . ")");
|
||||
$LogPrintExit info ("Updating daily PSK for " . $Ssid . " to " . $NewPsk . " (was " . $OldPsk . ")") false;
|
||||
/ caps-man access-list set $AccList private-passphrase=$NewPsk;
|
||||
|
||||
:if ([ / caps-man interface print count-only where configuration=$Configuration ] > 0) do={
|
||||
:foreach SeenSsid in=$Seen do={
|
||||
:if ($SeenSsid = $Ssid) do={
|
||||
:log debug ("Already sent a mail for SSID " . $Ssid . ", skipping.");
|
||||
$LogPrintExit debug ("Already sent a mail for SSID " . $Ssid . ", skipping.") false;
|
||||
:set Skip 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global Identity;
|
||||
:global DailyPskMatchComment;
|
||||
:global Identity;
|
||||
|
||||
:global LogPrintExit;
|
||||
:global SendNotification;
|
||||
:global UrlEncode;
|
||||
:global WaitForFile;
|
||||
|
@ -56,13 +57,13 @@
|
|||
:local Skip 0;
|
||||
|
||||
:if ($NewPsk != $OldPsk) do={
|
||||
:log info ("Updating daily PSK for " . $Ssid . " to " . $NewPsk . " (was " . $OldPsk . ")");
|
||||
$LogPrintExit info ("Updating daily PSK for " . $Ssid . " to " . $NewPsk . " (was " . $OldPsk . ")") false;
|
||||
/ interface wireless access-list set $AccList private-pre-shared-key=$NewPsk;
|
||||
|
||||
:if ([ / interface wireless print count-only where name=$IntName disabled=no ] = 1) do={
|
||||
:foreach SeenSsid in=$Seen do={
|
||||
:if ($SeenSsid = $Ssid) do={
|
||||
:log debug ("Already sent a mail for SSID " . $Ssid . ", skipping.");
|
||||
$LogPrintExit debug ("Already sent a mail for SSID " . $Ssid . ", skipping.") false;
|
||||
:set Skip 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
:global DailyPskMatchComment;
|
||||
:global Identity;
|
||||
|
||||
:global LogPrintExit;
|
||||
:global SendNotification;
|
||||
:global UrlEncode;
|
||||
:global WaitForFile;
|
||||
|
@ -60,7 +61,7 @@
|
|||
:local Skip 0;
|
||||
|
||||
:if ($NewPsk != $OldPsk) do={
|
||||
:log info ("Updating daily PSK for " . $Ssid . " to " . $NewPsk . " (was " . $OldPsk . ")");
|
||||
$LogPrintExit info ("Updating daily PSK for " . $Ssid . " to " . $NewPsk . " (was " . $OldPsk . ")") false;
|
||||
/ interface wireless access-list set $AccList private-pre-shared-key=$NewPsk;
|
||||
/ caps-man access-list set $AccList private-passphrase=$NewPsk;
|
||||
|
||||
|
@ -68,7 +69,7 @@
|
|||
:if ([ / caps-man interface print count-only where configuration=$Configuration ] > 0) do={
|
||||
:foreach SeenSsid in=$Seen do={
|
||||
:if ($SeenSsid = $Ssid) do={
|
||||
:log debug ("Already sent a mail for SSID " . $Ssid . ", skipping.");
|
||||
$LogPrintExit debug ("Already sent a mail for SSID " . $Ssid . ", skipping.") false;
|
||||
:set Skip 1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue