mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
email-daily-psk: use function for notification
This commit is contained in:
parent
5e4ef0ab8f
commit
9d53c82d1c
1 changed files with 5 additions and 4 deletions
|
@ -9,6 +9,8 @@
|
||||||
:global "email-general-cc";
|
:global "email-general-cc";
|
||||||
:global "daily-psk-match-comment";
|
:global "daily-psk-match-comment";
|
||||||
|
|
||||||
|
:global SendNotification;
|
||||||
|
|
||||||
:local seen [ :toarray "" ];
|
:local seen [ :toarray "" ];
|
||||||
|
|
||||||
:foreach acclist in=[ / interface wireless access-list find where comment~$"daily-psk-match-comment" ] do={
|
:foreach acclist in=[ / interface wireless access-list find where comment~$"daily-psk-match-comment" ] do={
|
||||||
|
@ -45,13 +47,12 @@
|
||||||
/ tool fetch mode=https check-certificate=yes-without-crl address=$host host=$host \
|
/ tool fetch mode=https check-certificate=yes-without-crl address=$host host=$host \
|
||||||
src-path=$srcpath dst-path=qrcode-daily.png;
|
src-path=$srcpath dst-path=qrcode-daily.png;
|
||||||
|
|
||||||
/ tool e-mail send to=$"email-general-to" cc=$"email-general-cc" \
|
$SendNotification ("[" . $identity . "] daily PSK " . $ssid) \
|
||||||
subject=("[" . $identity . "] daily PSK " . $ssid) \
|
("This is the daily PSK on " . $identity . ":\n\n" . \
|
||||||
body=("This is the daily PSK on " . $identity . ":\n\n" . \
|
|
||||||
"SSID: " . $ssid . "\n" . \
|
"SSID: " . $ssid . "\n" . \
|
||||||
"PSK: " . $psk . "\n" . \
|
"PSK: " . $psk . "\n" . \
|
||||||
"Date: " . [ / system clock get date ] . "\n\n" . \
|
"Date: " . [ / system clock get date ] . "\n\n" . \
|
||||||
"https://" . $host . $srcpath) \
|
"https://" . $host . $srcpath) \
|
||||||
file=qrcode-daily.png;
|
"qrcode-daily.png";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue