From e9cdf947855880c0b7299ed7e2dd1770f71c5cfb Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 24 Jun 2019 13:30:36 +0200 Subject: add script 'certificate-renew-issued' --- certificate-renew-issued | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 certificate-renew-issued diff --git a/certificate-renew-issued b/certificate-renew-issued new file mode 100644 index 0000000..e7241f2 --- /dev/null +++ b/certificate-renew-issued @@ -0,0 +1,14 @@ +#!rsc +# RouterOS script: certificate-renew-issued +# Copyright (c) 2019 Christian Hesse +# +# renew locally issued certificates + +: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"); +} -- cgit v1.2.3-70-g09d2