From 16bf58546355690e0d9cf4e7d181255aac73b5c6 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Wed, 8 Jan 2014 23:15:50 +0100 Subject: 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. 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 do url="${mirror%/}/timestamp" - if curl -s -S -O -P '-' -m 600 --retry 2 --ftp-method 'nocwd' "$url" \ - >'curl.log' 2>&1 + if ncftpget -V -t 600 "$url" >'ftp.log' 2>&1 then cmp -s 'expected' 'timestamp' \ || echo >&2 "$mirror is outdated ($(cat 'timestamp'))." else - echo >&2 "Cannot fetch $url: $(cat 'curl.log')" + tail -n 1 'ftp.log' >&2 fi + rm -f 'timestamp' done cd "$OLDPWD" date '+%F' >"$download_dir/timestamp" -- cgit v0.10-9-g596f