From 204944374e9a238b8f1e315d204bda5423fbc276 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Thu, 29 Oct 2020 12:34:36 +0100 Subject: [PATCH] run wget --help once --- builder.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/builder.sh b/builder.sh index f138da9..23e1822 100755 --- a/builder.sh +++ b/builder.sh @@ -270,12 +270,13 @@ download_axel() { } download_wget() { - local outfile=$1 url=$2 retval + local outfile=$1 url=$2 retval wget_help if [ -z "${WGET_OPTS_SET+x}" ]; then - wget --help 2>&1 | grep -q -- ' --no-check-certificate ' && WGET_OPTS="$WGET_OPTS --no-check-certificate" - wget --help 2>&1 | grep -q -- ' --inet ' && WGET_OPTS="$WGET_OPTS --inet" - wget --help 2>&1 | grep -q -- ' --retry-connrefused ' && WGET_OPTS="$WGET_OPTS --retry-connrefused" - wget --help 2>&1 | grep -q -- ' --no-iri ' && WGET_OPTS="$WGET_OPTS --no-iri" + wget_help="$(wget --help 2>&1)" + echo "$wget_help" | grep -q -- ' --no-check-certificate ' && WGET_OPTS="$WGET_OPTS --no-check-certificate" + echo "$wget_help" | grep -q -- ' --inet ' && WGET_OPTS="$WGET_OPTS --inet" + echo "$wget_help" | grep -q -- ' --retry-connrefused ' && WGET_OPTS="$WGET_OPTS --retry-connrefused" + echo "$wget_help" | grep -q -- ' --no-iri ' && WGET_OPTS="$WGET_OPTS --no-iri" WGET_OPTS="-c -nd -t$WGET_RETRIES $WGET_OPTS --user-agent=$USER_AGENT $IPOPT --passive-ftp" WGET_OPTS_SET=1 fi -- 2.43.0