mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-01-22 08:59:33 +00:00
certificate-renew-issued: early exit with :exit
This commit is contained in:
parent
9851ffb927
commit
d9f5105b02
1 changed files with 2 additions and 4 deletions
|
|
@ -8,7 +8,6 @@
|
||||||
# renew locally issued certificates
|
# renew locally issued certificates
|
||||||
# https://rsc.eworm.de/doc/certificate-renew-issued.md
|
# https://rsc.eworm.de/doc/certificate-renew-issued.md
|
||||||
|
|
||||||
:local ExitOK false;
|
|
||||||
:onerror Err {
|
:onerror Err {
|
||||||
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
||||||
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
||||||
|
|
@ -22,8 +21,7 @@
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||||
:set ExitOK true;
|
:exit;
|
||||||
:error false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:foreach Cert in=[ /certificate/find where issued expires-after<3w ] do={
|
:foreach Cert in=[ /certificate/find where issued expires-after<3w ] do={
|
||||||
|
|
@ -48,5 +46,5 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} do={
|
} do={
|
||||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
:global ExitError; $ExitError false [ :jobname ] $Err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue