summaryrefslogtreecommitdiffstats
path: root/bin/check-mirrors
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2014-01-08 22:15:50 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2014-01-08 22:15:50 (GMT)
commit16bf58546355690e0d9cf4e7d181255aac73b5c6 (patch)
treead48c3e1970b01f302782df029ddd40244bbe3e2 /bin/check-mirrors
parentd4d4ddde3e2bfd2f3ab3655c1d533c3f36261a01 (diff)
downloadsite-16bf58546355690e0d9cf4e7d181255aac73b5c6.tar.gz
check-mirrors: Use ncftpget(1) instead of curl(1)
Some of our FTP mirrors seem to have trouble with active mode, others with passive mode. Unlike curl(1), ncftpget(1) supports falling back to active mode if passive mode fails.
Diffstat (limited to 'bin/check-mirrors')
-rwxr-xr-xbin/check-mirrors6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/check-mirrors b/bin/check-mirrors
index d3fcfe9..ab343e0 100755
--- a/bin/check-mirrors
+++ b/bin/check-mirrors
@@ -264,14 +264,14 @@ for mirror in $mirrors
264do 264do
265 url="${mirror%/}/timestamp" 265 url="${mirror%/}/timestamp"
266 266
267 if curl -s -S -O -P '-' -m 600 --retry 2 --ftp-method 'nocwd' "$url" \ 267 if ncftpget -V -t 600 "$url" >'ftp.log' 2>&1
268 >'curl.log' 2>&1
269 then 268 then
270 cmp -s 'expected' 'timestamp' \ 269 cmp -s 'expected' 'timestamp' \
271 || echo >&2 "$mirror is outdated ($(cat 'timestamp'))." 270 || echo >&2 "$mirror is outdated ($(cat 'timestamp'))."
272 else 271 else
273 echo >&2 "Cannot fetch $url: $(cat 'curl.log')" 272 tail -n 1 'ftp.log' >&2
274 fi 273 fi
274 rm -f 'timestamp'
275done 275done
276cd "$OLDPWD" 276cd "$OLDPWD"
277date '+%F' >"$download_dir/timestamp" 277date '+%F' >"$download_dir/timestamp"