Use curl
if not running on OpenBSD
This commit is contained in:
parent
6bbdb29b10
commit
8de76cf8b1
2 changed files with 28 additions and 2 deletions
|
@ -22,6 +22,19 @@ err()
|
|||
exit 1
|
||||
}
|
||||
|
||||
fetch_file()
|
||||
{
|
||||
# Assumes utility supports `-o output_file`
|
||||
case $(uname) in
|
||||
OpenBSD)
|
||||
$torsocks ftp -MV "$@"
|
||||
;;
|
||||
*)
|
||||
$torsocks curl -fLSs "$@"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
tonumber()
|
||||
{
|
||||
printf "%u" "$1" 2>/dev/null
|
||||
|
@ -44,6 +57,6 @@ url=https://tools.ietf.org/rfc/rfc$n.txt
|
|||
|
||||
mkdir -p "$RFCDIR"
|
||||
if [ ! -f "$rfcfile" ]; then
|
||||
$torsocks ftp -Vo "$rfcfile" "$url" || err "couldn't fetch RFC $n"
|
||||
fetch_file -o "$rfcfile" "$url" || err "couldn't fetch RFC $n"
|
||||
fi
|
||||
${PAGER:-more} "$rfcfile"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue