From: Lukas Schauer Date: Wed, 16 Dec 2015 12:46:33 +0000 (+0100) Subject: replace pcre-ism with posix class (thanks to @awaw, fixes #52) X-Git-Tag: v0.1.0~117 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=760b6894072ee7d1eb78d0e44db0e2aca7afca9c;p=thirdparty%2Fdehydrated.git replace pcre-ism with posix class (thanks to @awaw, fixes #52) --- diff --git a/letsencrypt.sh b/letsencrypt.sh index 34ad3af..64ac436 100755 --- a/letsencrypt.sh +++ b/letsencrypt.sh @@ -193,7 +193,7 @@ hex2bin() { } get_json_string_value() { - grep -Eo '"'"${1}"'":\s*"[^"]*"' | cut -d'"' -f4 + grep -Eo '"'"${1}"'":[[:space:]]*"[^"]*"' | cut -d'"' -f4 } get_json_array() { @@ -408,7 +408,7 @@ command_sign_domains() { echo "${PARAM_DOMAIN}" > "${DOMAINS_TXT}" fi # Generate certificates for all domains found in domains.txt. Check if existing certificate are about to expire - <"${DOMAINS_TXT}" sed 's/^[ ]*//g;s/[ ]*$//g' | grep -v '^#' | grep -v '^$' | while read -r line; do + <"${DOMAINS_TXT}" sed 's/^[[:space:]]*//g;s/[[:space:]]*$//g' | grep -vE '^(#|$)' | while read -r line; do domain="$(printf '%s\n' "${line}" | cut -d' ' -f1)" morenames="$(printf '%s\n' "${line}" | cut -s -d' ' -f2-)" cert="${BASEDIR}/certs/${domain}/cert.pem" @@ -475,7 +475,7 @@ command_help() { echo ( echo "Commands:" - grep -e '^\s*# Usage:' -e '^\s*# Description:' -e '^command_.*()\s*{' "${0}" | while read -r usage; read -r description; read -r command; do + grep -e '^[[:space:]]*# Usage:' -e '^[[:space:]]*# Description:' -e '^command_.*()[[:space:]]*{' "${0}" | while read -r usage; read -r description; read -r command; do if [[ ! "${usage}" =~ Usage ]] || [[ ! "${description}" =~ Description ]] || [[ ! "${command}" =~ ^command_ ]]; then echo "Error generating help text." >&2 exit 1 @@ -484,7 +484,7 @@ command_help() { done echo "---" echo "Parameters:" - grep -E -e '^\s*# PARAM_Usage:' -e '^\s*# PARAM_Description:' "${0}" | while read -r usage; read -r description; do + grep -E -e '^[[:space:]]*# PARAM_Usage:' -e '^[[:space:]]*# PARAM_Description:' "${0}" | while read -r usage; read -r description; do if [[ ! "${usage}" =~ Usage ]] || [[ ! "${description}" =~ Description ]]; then echo "Error generating help text." >&2 exit 1