mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
global-functions: detect failed package downloads
This commit is contained in:
@@ -178,9 +178,17 @@
|
||||
/ tool fetch mode=https check-certificate=yes-without-crl \
|
||||
("https://upgrade.mikrotik.com/routeros/" . $PkgVer . "/" . $PkgFile) \
|
||||
dst-path=$PkgDest;
|
||||
:return true;
|
||||
} on-error={
|
||||
/ file remove [ find where name=$PkgDest ];
|
||||
:return false;
|
||||
}
|
||||
|
||||
# Fetch tool in RouterOS has an issue where it truncates files on slow
|
||||
# storage. Detect that... TODO: Remove when fixed. (Ticket#2019021122006199)
|
||||
:if ([ / file get [ find where name=$PkgDest ] type ] != "package") do={
|
||||
/ file remove [ find where name=$PkgDest ];
|
||||
:return false;
|
||||
}
|
||||
|
||||
:return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user