mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
15 lines
631 B
Text
15 lines
631 B
Text
|
#!rsc
|
||
|
# RouterOS script: certificate-renew-issued
|
||
|
# Copyright (c) 2019 Christian Hesse <mail@eworm.de>
|
||
|
#
|
||
|
# 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");
|
||
|
}
|