diff options
author | Christian Hesse <mail@eworm.de> | 2022-05-10 14:41:16 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-05-11 13:48:27 +0200 |
commit | 0f3166d4275d9cb2ae3a2fe3337ee042394921ec (patch) | |
tree | a23f21c834e06539b28a285b08184c3d43406a97 | |
parent | f17342ed6ec05d15cefcc00cfd6b1677175f1fd4 (diff) |
certificate-renew-issued: RouterOS v7 path syntax
-rw-r--r-- | certificate-renew-issued | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/certificate-renew-issued b/certificate-renew-issued index 72b723f..29aaa93 100644 --- a/certificate-renew-issued +++ b/certificate-renew-issued @@ -15,16 +15,16 @@ :global LogPrintExit2; :global MkDir; -:foreach Cert in=[ / certificate find where issued expires-after<3w ] do={ - :local CertVal [ / certificate get $Cert ]; - / certificate issued-revoke $Cert; - / certificate set name=($CertVal->"name" . "-revoked-" . [ / system clock get date ]) $Cert; - / certificate add name=($CertVal->"name") common-name=($CertVal->"common-name") \ +:foreach Cert in=[ /certificate/find where issued expires-after<3w ] do={ + :local CertVal [ /certificate/get $Cert ]; + /certificate/issued-revoke $Cert; + /certificate/set name=($CertVal->"name" . "-revoked-" . [ /system/clock/get date ]) $Cert; + /certificate/add name=($CertVal->"name") common-name=($CertVal->"common-name") \ key-usage=($CertVal->"key-usage") subject-alt-name=($CertVal->"subject-alt-name"); - / certificate sign ($CertVal->"name") ca=($CertVal->"ca"); + /certificate/sign ($CertVal->"name") ca=($CertVal->"ca"); :if ([ :typeof ($CertIssuedExportPass->($CertVal->"common-name")) ] = "str") do={ :if ([ $MkDir "cert-issued" ] = true) do={ - / certificate export-certificate ($CertVal->"name") type=pkcs12 \ + /certificate/export-certificate ($CertVal->"name") type=pkcs12 \ file-name=("cert-issued/" . $CertVal->"common-name") \ export-passphrase=($CertIssuedExportPass->($CertVal->"common-name")); $LogPrintExit2 info $0 ("Issued a new certificate for \"" . $CertVal->"common-name" . \ |