mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-03-04 21:19:36 +00:00
global-functions: $DownloadPackage: use $FileExists
This commit is contained in:
parent
e89ae83bf1
commit
ddbd6217fc
1 changed files with 3 additions and 2 deletions
|
|
@ -364,6 +364,7 @@
|
||||||
|
|
||||||
:global CertificateAvailable;
|
:global CertificateAvailable;
|
||||||
:global CleanFilePath;
|
:global CleanFilePath;
|
||||||
|
:global FileExists;
|
||||||
:global LogPrint;
|
:global LogPrint;
|
||||||
:global MkDir;
|
:global MkDir;
|
||||||
:global RmFile;
|
:global RmFile;
|
||||||
|
|
@ -384,7 +385,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;
|
||||||
}
|
}
|
||||||
|
|
@ -406,7 +407,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