mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-28 05:54:54 +02:00
global-functions: $FetchHuge: make sure to work with clean file names
This commit is contained in:
parent
2edf983698
commit
61ee5cbd6c
1 changed files with 4 additions and 3 deletions
|
@ -396,6 +396,7 @@
|
||||||
:local Url [ :tostr $2 ];
|
:local Url [ :tostr $2 ];
|
||||||
:local CheckCert [ :tobool $3 ];
|
:local CheckCert [ :tobool $3 ];
|
||||||
|
|
||||||
|
:global CleanName;
|
||||||
:global FetchUserAgentStr;
|
:global FetchUserAgentStr;
|
||||||
:global GetRandom20CharAlNum;
|
:global GetRandom20CharAlNum;
|
||||||
:global IfThenElse;
|
:global IfThenElse;
|
||||||
|
@ -405,13 +406,13 @@
|
||||||
|
|
||||||
:set CheckCert [ $IfThenElse ($CheckCert = false) "no" "yes-without-crl" ];
|
:set CheckCert [ $IfThenElse ($CheckCert = false) "no" "yes-without-crl" ];
|
||||||
|
|
||||||
:if ([ $MkDir "tmpfs/" . $ScriptName ] = false) do={
|
:local FileName ("tmpfs/" . [ $CleanName $ScriptName ]);
|
||||||
|
:if ([ $MkDir $FileName ] = false) do={
|
||||||
$LogPrint error $0 ("Failed creating directory!");
|
$LogPrint error $0 ("Failed creating directory!");
|
||||||
:return false;
|
:return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
:local FileName ("tmpfs/" . $ScriptName . "/" . $0 . "-" . [ $GetRandom20CharAlNum ]);
|
:set FileName ($FileName . "/" . [ $CleanName $0 ] . "-" . [ $GetRandom20CharAlNum ]);
|
||||||
|
|
||||||
:do {
|
:do {
|
||||||
/tool/fetch check-certificate=$CheckCert $Url dst-path=$FileName \
|
/tool/fetch check-certificate=$CheckCert $Url dst-path=$FileName \
|
||||||
http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) as-value;
|
http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) as-value;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue