mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-12-23 02:09:30 +00:00
global: give script or function name in log messages
This commit is contained in:
parent
b0e52aa2d1
commit
f46db91845
46 changed files with 262 additions and 212 deletions
|
|
@ -6,12 +6,13 @@
|
|||
# renew locally issued certificates
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/certificate-renew-issued.md
|
||||
|
||||
:local 0 "certificate-renew-issued";
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:global CertIssuedExportPass;
|
||||
|
||||
:global LogPrintExit;
|
||||
:global LogPrintExit2;
|
||||
:global MkDir;
|
||||
|
||||
:foreach Cert in=[ / certificate find where issued expires-after<3w ] do={
|
||||
|
|
@ -26,12 +27,12 @@
|
|||
/ certificate export-certificate ($CertVal->"name") type=pkcs12 \
|
||||
file-name=("cert-issued/" . $CertVal->"common-name") \
|
||||
export-passphrase=($CertIssuedExportPass->($CertVal->"common-name"));
|
||||
$LogPrintExit info ("Issued a new certificate for \"" . $CertVal->"common-name" . \
|
||||
$LogPrintExit2 info $0 ("Issued a new certificate for \"" . $CertVal->"common-name" . \
|
||||
"\", exported to \"cert-issued/" . $CertVal->"common-name" . ".p12\".") false;
|
||||
} else={
|
||||
$LogPrintExit warning ("Failed creating directory, not exporting certificate.") false;
|
||||
$LogPrintExit2 warning $0 ("Failed creating directory, not exporting certificate.") false;
|
||||
}
|
||||
} else={
|
||||
$LogPrintExit info ("Issued a new certificate for \"" . $CertVal->"common-name" . "\".") false;
|
||||
$LogPrintExit2 info $0 ("Issued a new certificate for \"" . $CertVal->"common-name" . "\".") false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue