mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-06-20 17:55:40 +02:00
global-functions: $DownloadPackage: use $FileExists ...
... to work around restrictions in new file handling.
This commit is contained in:
parent
cb984a5e52
commit
8353a8547f
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