diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2014-01-08 22:15:50 (GMT) |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2014-01-08 22:15:50 (GMT) |
commit | 16bf58546355690e0d9cf4e7d181255aac73b5c6 (patch) | |
tree | ad48c3e1970b01f302782df029ddd40244bbe3e2 | |
parent | d4d4ddde3e2bfd2f3ab3655c1d533c3f36261a01 (diff) | |
download | site-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.
-rwxr-xr-x | bin/check-mirrors | 6 |
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 | |||
264 | do | 264 | do |
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' | ||
275 | done | 275 | done |
276 | cd "$OLDPWD" | 276 | cd "$OLDPWD" |
277 | date '+%F' >"$download_dir/timestamp" | 277 | date '+%F' >"$download_dir/timestamp" |