mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-05-16 11:57:01 +02:00
temporarily store raw curl version output to fix check (fixes #717)
This commit is contained in:
@@ -47,13 +47,15 @@ check_dependencies() {
|
|||||||
command -v diff > /dev/null 2>&1 || _exiterr "This script requires diff."
|
command -v diff > /dev/null 2>&1 || _exiterr "This script requires diff."
|
||||||
|
|
||||||
# curl returns with an error code in some ancient versions so we have to catch that
|
# curl returns with an error code in some ancient versions so we have to catch that
|
||||||
|
# storing raw version output temporarily to catch curl error instead of head/awk exit codes
|
||||||
set +e
|
set +e
|
||||||
CURL_VERSION="$(curl -V 2>&1 | head -n1 | awk '{print $2}')"
|
raw_curl_version="$(curl -V 2>&1)"
|
||||||
retcode="$?"
|
retcode="$?"
|
||||||
set -e
|
set -e
|
||||||
if [[ ! "${retcode}" = "0" ]] && [[ ! "${retcode}" = "2" ]]; then
|
if [[ ! "${retcode}" = "0" ]] && [[ ! "${retcode}" = "2" ]]; then
|
||||||
_exiterr "This script requires curl."
|
_exiterr "This script requires curl."
|
||||||
fi
|
fi
|
||||||
|
CURL_VERSION="$(head -n1 <<< "${raw_curl_version}" | awk '{print $2}')"
|
||||||
}
|
}
|
||||||
|
|
||||||
store_configvars() {
|
store_configvars() {
|
||||||
|
|||||||
Reference in New Issue
Block a user