mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-04 18:24:34 +02:00
add script 'certificate-renew-issued'
This commit is contained in:
parent
5101d57d52
commit
e9cdf94785
1 changed files with 14 additions and 0 deletions
14
certificate-renew-issued
Normal file
14
certificate-renew-issued
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!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");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue