mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-03-04 13:09:37 +00:00
global-functions: $DownloadPackage: use $FileExists
This commit is contained in:
parent
c1bb4f095e
commit
0ef506a862
1 changed files with 3 additions and 2 deletions
|
|
@ -364,6 +364,7 @@
|
|||
|
||||
:global CertificateAvailable;
|
||||
:global CleanFilePath;
|
||||
:global FileExists;
|
||||
:global LogPrint;
|
||||
:global MkDir;
|
||||
:global RmFile;
|
||||
|
|
@ -384,7 +385,7 @@
|
|||
:return false;
|
||||
}
|
||||
|
||||
:if ([ :len [ /file/find where name=$PkgDest type="package" ] ] > 0) do={
|
||||
:if ([ $FileExists $PkgDest "package" ] = true) do={
|
||||
$LogPrint info $0 ("Package file " . $PkgName . " already exists.");
|
||||
:return true;
|
||||
}
|
||||
|
|
@ -406,7 +407,7 @@
|
|||
:return false;
|
||||
}
|
||||
|
||||
:if ([ /file/get [ find where name=$PkgDest ] type ] != "package") do={
|
||||
:if ([ $FileExists $PkgDest "package" ] = false) do={
|
||||
$LogPrint warning $0 ("Downloaded file is not a package, removing.");
|
||||
$RmFile $PkgDest;
|
||||
:return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue