mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-03-05 13:39:35 +00:00
global-functions: $DownloadPackage: use $FileExists
This commit is contained in:
parent
beb0798bd5
commit
f8eff5b795
1 changed files with 3 additions and 2 deletions
|
|
@ -365,6 +365,7 @@
|
||||||
|
|
||||||
:global CertificateAvailable;
|
:global CertificateAvailable;
|
||||||
:global CleanFilePath;
|
:global CleanFilePath;
|
||||||
|
:global FileExists;
|
||||||
:global LogPrint;
|
:global LogPrint;
|
||||||
:global MkDir;
|
:global MkDir;
|
||||||
:global RmFile;
|
:global RmFile;
|
||||||
|
|
@ -385,7 +386,7 @@
|
||||||
:return false;
|
: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.");
|
$LogPrint info $0 ("Package file " . $PkgName . " already exists.");
|
||||||
:return true;
|
:return true;
|
||||||
}
|
}
|
||||||
|
|
@ -407,7 +408,7 @@
|
||||||
:return false;
|
: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.");
|
$LogPrint warning $0 ("Downloaded file is not a package, removing.");
|
||||||
$RmFile $PkgDest;
|
$RmFile $PkgDest;
|
||||||
:return false;
|
:return false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue