mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-07-25 13:24:30 +02:00
mod/scriptrunonce: use $FetchHuge
This commit is contained in:
parent
df631b987d
commit
b7b3b43f3b
1 changed files with 4 additions and 5 deletions
|
@ -4,7 +4,6 @@
|
||||||
# https://rsc.eworm.de/COPYING.md
|
# https://rsc.eworm.de/COPYING.md
|
||||||
#
|
#
|
||||||
# requires RouterOS, version=7.15
|
# requires RouterOS, version=7.15
|
||||||
# requires device-mode, fetch
|
|
||||||
#
|
#
|
||||||
# download script and run it once
|
# download script and run it once
|
||||||
# https://rsc.eworm.de/doc/mod/scriptrunonce.md
|
# https://rsc.eworm.de/doc/mod/scriptrunonce.md
|
||||||
|
@ -18,6 +17,7 @@
|
||||||
:global ScriptRunOnceBaseUrl;
|
:global ScriptRunOnceBaseUrl;
|
||||||
:global ScriptRunOnceUrlSuffix;
|
:global ScriptRunOnceUrlSuffix;
|
||||||
|
|
||||||
|
:global FetchHuge;
|
||||||
:global LogPrint;
|
:global LogPrint;
|
||||||
:global ValidateSyntax;
|
:global ValidateSyntax;
|
||||||
|
|
||||||
|
@ -30,11 +30,10 @@
|
||||||
:set Script ($ScriptRunOnceBaseUrl . $Script . ".rsc" . $ScriptRunOnceUrlSuffix);
|
:set Script ($ScriptRunOnceBaseUrl . $Script . ".rsc" . $ScriptRunOnceUrlSuffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
:local Source;
|
:local Source [ $FetchHuge $0 $Script true ];
|
||||||
:do {
|
:if ($Source = false) do={
|
||||||
:set Source ([ /tool/fetch check-certificate=yes-without-crl $Script output=user as-value ]->"data");
|
|
||||||
} on-error={
|
|
||||||
$LogPrint warning $0 ("Failed fetching script '" . $Script . "'!");
|
$LogPrint warning $0 ("Failed fetching script '" . $Script . "'!");
|
||||||
|
:return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ :len $Source ] > 0) do={
|
:if ([ :len $Source ] > 0) do={
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue