From: Andreas Thienemann Date: Sun, 28 May 2017 16:30:58 +0000 (+0200) Subject: Support older bash releases X-Git-Tag: v0.5.0~50 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=9ea75e7cfbcdfe30be2934fd293012c66677b7db;p=thirdparty%2Fdehydrated.git Support older bash releases Bash 3.0 and others seem to have serious issues running dehydrated. https://github.com/lukas2511/dehydrated/issues/284 tracks the problem but got closed as it seems too hard to support "stone age" distributions. Turns out it is actually only a three line change. ;-) --- diff --git a/dehydrated b/dehydrated index 34a3ffb..ec3a6ae 100755 --- a/dehydrated +++ b/dehydrated @@ -77,14 +77,14 @@ reset_configvars() { # verify configuration values verify_config() { - [[ "${CHALLENGETYPE}" =~ (http-01|dns-01) ]] || _exiterr "Unknown challenge type ${CHALLENGETYPE}... can not continue." + [[ "${CHALLENGETYPE}" == "http-01" || "${CHALLENGETYPE}" == "dns-01" ]] || _exiterr "Unknown challenge type ${CHALLENGETYPE}... can not continue." if [[ "${CHALLENGETYPE}" = "dns-01" ]] && [[ -z "${HOOK}" ]]; then _exiterr "Challenge type dns-01 needs a hook script for deployment... can not continue." fi if [[ "${CHALLENGETYPE}" = "http-01" && ! -d "${WELLKNOWN}" && ! "${COMMAND:-}" = "register" ]]; then _exiterr "WELLKNOWN directory doesn't exist, please create ${WELLKNOWN} and set appropriate permissions." fi - [[ "${KEY_ALGO}" =~ ^(rsa|prime256v1|secp384r1)$ ]] || _exiterr "Unknown public key algorithm ${KEY_ALGO}... can not continue." + [[ "${KEY_ALGO}" == "rsa" || "${KEY_ALGO}" == "prime256v1" || "${KEY_ALGO}" == "secp384r1" ]] || _exiterr "Unknown public key algorithm ${KEY_ALGO}... can not continue." if [[ -n "${IP_VERSION}" ]]; then [[ "${IP_VERSION}" = "4" || "${IP_VERSION}" = "6" ]] || _exiterr "Unknown IP version ${IP_VERSION}... can not continue." fi @@ -748,7 +748,7 @@ sign_domain() { echo " + Generating signing request..." SAN="" for altname in ${altnames}; do - SAN+="DNS:${altname}, " + SAN="${SAN}DNS:${altname}, " done SAN="${SAN%%, }" local tmp_openssl_cnf