local/bin/rget: Fall back to HTTP when rsync fails.
parent
f1d7419c3a
commit
31ffdbd505
|
@ -62,10 +62,18 @@ rsync*)
|
|||
fi
|
||||
esac
|
||||
|
||||
get_wget () {
|
||||
wget --reject 'index.html*' $OPT_SINGLE --continue --content-disposition --compression=gzip --no-proxy "$1" --directory-prefix="$OUTPUT"
|
||||
}
|
||||
|
||||
mkdir -p "$OUTPUT"
|
||||
if $OPT_HTTP; then
|
||||
wget --reject 'index.html*' $OPT_SINGLE --continue --content-disposition --compression=gzip --no-proxy "$ADDRESS" --directory-prefix="$OUTPUT"
|
||||
get_wget "$ADDRESS"
|
||||
else
|
||||
# We ignore timestamp by removing "-t" from "-a". See man page.
|
||||
rsync -ivzzP -rlpgoD --size-only $ADDRESS/files "$OUTPUT"
|
||||
if [ $? = 5 ]; then
|
||||
echo "Looks like HTTP, retrying with wget..."
|
||||
get_wget $(echo "$ADDRESS" | sed s/^rsync/http/)
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue