diff options
author | Christian Hesse <mail@eworm.de> | 2021-02-22 15:14:10 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-02-24 21:51:54 +0100 |
commit | f46db918453dcb8878b9a0de6e122fb0ea2224d9 (patch) | |
tree | 31544a450651d0705ecdea0c3d35e650ef784d67 /certificate-renew-issued | |
parent | b0e52aa2d1baa78fc9d025c0671fea8babba0ec2 (diff) |
global: give script or function name in log messages
Diffstat (limited to 'certificate-renew-issued')
-rw-r--r-- | certificate-renew-issued | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/certificate-renew-issued b/certificate-renew-issued index 2345f30..c8ce4ae 100644 --- a/certificate-renew-issued +++ b/certificate-renew-issued @@ -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; } } |