mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-07 11:44:45 +02:00
global-functions: $CertificateDownload: use $RmFile
This commit is contained in:
parent
82020ddd73
commit
dbdf295244
1 changed files with 3 additions and 2 deletions
|
@ -149,6 +149,7 @@
|
||||||
:global CleanName;
|
:global CleanName;
|
||||||
:global FetchUserAgentStr;
|
:global FetchUserAgentStr;
|
||||||
:global LogPrint;
|
:global LogPrint;
|
||||||
|
:global RmFile;
|
||||||
:global WaitForFile;
|
:global WaitForFile;
|
||||||
|
|
||||||
$LogPrint info $0 ("Downloading and importing certificate with " . \
|
$LogPrint info $0 ("Downloading and importing certificate with " . \
|
||||||
|
@ -172,7 +173,7 @@
|
||||||
dst-path=$FileName as-value;
|
dst-path=$FileName as-value;
|
||||||
$WaitForFile $FileName;
|
$WaitForFile $FileName;
|
||||||
:if ([ /file/get $FileName size ] = 0) do={
|
:if ([ /file/get $FileName size ] = 0) do={
|
||||||
/file/remove $FileName;
|
$RmFile $FileName;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
} on-error={
|
} on-error={
|
||||||
|
@ -183,7 +184,7 @@
|
||||||
|
|
||||||
/certificate/import file-name=$FileName passphrase="" as-value;
|
/certificate/import file-name=$FileName passphrase="" as-value;
|
||||||
:delay 1s;
|
:delay 1s;
|
||||||
/file/remove [ find where name=$FileName ];
|
$RmFile $FileName;
|
||||||
|
|
||||||
:if ([ :len [ /certificate/find where common-name=$CommonName ] ] = 0) do={
|
:if ([ :len [ /certificate/find where common-name=$CommonName ] ] = 0) do={
|
||||||
/certificate/remove [ find where name~("^" . $FileName . "_[0-9]+\$") ];
|
/certificate/remove [ find where name~("^" . $FileName . "_[0-9]+\$") ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue