mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-24 12:54:28 +02:00
global-functions: $WaitForFile: check that we can get properties
Looks like RouterOS 7.18beta2 brings more breakage. Having a file available in listing is just the first step now. We also need to make sure that the file properties are accessible... 🤪 I have seen this taking several tens of seconds at least... 🤪🤪 So let's just try until we have properties available, or the file vanishes. Reported as SUP-179200. 🤞
This commit is contained in:
parent
d41f758550
commit
c8759381e9
1 changed files with 15 additions and 1 deletions
|
@ -1669,6 +1669,7 @@
|
|||
|
||||
:global CleanFilePath;
|
||||
:global EitherOr;
|
||||
:global LogPrintOnce;
|
||||
:global MAX;
|
||||
|
||||
:set FileName [ $CleanFilePath $FileName ];
|
||||
|
@ -1682,7 +1683,20 @@
|
|||
:delay $Delay;
|
||||
:set I ($I + 1);
|
||||
}
|
||||
:return true;
|
||||
|
||||
:while ([ :len [ /file/find where name=$FileName ] ] > 0) do={
|
||||
:do {
|
||||
/file/get $FileName;
|
||||
:return true;
|
||||
} on-error={
|
||||
$LogPrintOnce warning $0 \
|
||||
("Hit the infamous file handling breakage (SUP-179200) introduced with RouterOS 7.18beta2...");
|
||||
}
|
||||
:delay $Delay;
|
||||
:set Delay ($Delay * 3 / 2);
|
||||
}
|
||||
|
||||
:return false;
|
||||
}
|
||||
|
||||
# wait to be fully connected (default route is reachable, time is sync, DNS resolves)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue