aboutsummaryrefslogtreecommitdiffstats
path: root/daily-psk.template
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-04-18 10:39:32 +0200
committerGravatar Christian Hesse <mail@eworm.de>2019-04-30 16:52:53 +0200
commit7f96e5c9669f30cd22914de7f092d009faddf304 (patch)
treed9b80f84ff3e4d65b75603c8e7d1a0a429cb7eb7 /daily-psk.template
parent9aac873163051aef8c1f8b5b959e5796a5341e1a (diff)
global-functions: add $WaitForFile, wait for file on fetch
The fetch command is asynchronous, the file is not guaranteed to be available when command terminates. I opened an issue at Mikrotik support (Ticket#2019041722004999), their answer: > You should perform a check in a loop. > :delay until file exist > > That can happen also with any configuration not just files. So add a function to wait for a file with given name. I have not seen this with other configuration, though.
Diffstat (limited to 'daily-psk.template')
-rw-r--r--daily-psk.template4
1 files changed, 3 insertions, 1 deletions
diff --git a/daily-psk.template b/daily-psk.template
index 4cb7cd2..dfbac13 100644
--- a/daily-psk.template
+++ b/daily-psk.template
@@ -10,9 +10,10 @@
:global Identity;
:global DailyPskMatchComment;
-:global UrlEncode;
:global SendNotification;
+:global UrlEncode;
+:global WaitForFile;
:local Seen [ :toarray "" ];
@@ -82,6 +83,7 @@
:do {
/ tool fetch check-certificate=yes-without-crl \
$Url dst-path=$Attach;
+ $WaitForFile $Attach;
} on-error={
:set Attach "";
}