mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-04-24 09:18:28 +02:00
making shellcheck happy
This commit is contained in:
@@ -16,6 +16,7 @@ BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|||||||
|
|
||||||
# If exists load config from same directory as this script
|
# If exists load config from same directory as this script
|
||||||
if [[ -e "${BASEDIR}/config.sh" ]]; then
|
if [[ -e "${BASEDIR}/config.sh" ]]; then
|
||||||
|
# shellcheck disable=SC1090
|
||||||
. "${BASEDIR}/config.sh"
|
. "${BASEDIR}/config.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -53,7 +54,7 @@ hex2bin() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Convert to binary data
|
# Convert to binary data
|
||||||
printf "${escapedhex}"
|
printf -- "${escapedhex}"
|
||||||
}
|
}
|
||||||
|
|
||||||
_request() {
|
_request() {
|
||||||
@@ -221,7 +222,7 @@ fi
|
|||||||
|
|
||||||
# Generate certificates for all domains found in domain.txt. Check if existing certificate are about to expire
|
# Generate certificates for all domains found in domain.txt. Check if existing certificate are about to expire
|
||||||
<domains.txt sed 's/^\s*//g;s/\s*$//g' | grep -v '^#' | grep -v '^$' | while read -r line; do
|
<domains.txt sed 's/^\s*//g;s/\s*$//g' | grep -v '^#' | grep -v '^$' | while read -r line; do
|
||||||
domain="$(echo $line | cut -d' ' -f1)"
|
domain="$(echo "${line}" | cut -d' ' -f1)"
|
||||||
cert="${BASEDIR}/certs/${domain}/cert.pem"
|
cert="${BASEDIR}/certs/${domain}/cert.pem"
|
||||||
|
|
||||||
echo "Processing ${domain}"
|
echo "Processing ${domain}"
|
||||||
@@ -229,7 +230,7 @@ fi
|
|||||||
echo " + Found existing cert..."
|
echo " + Found existing cert..."
|
||||||
|
|
||||||
# Turning off exit on non-zero status for cert validation
|
# Turning off exit on non-zero status for cert validation
|
||||||
set +e; openssl x509 -checkend $((${RENEW_DAYS} * 86400)) -noout -in "${cert}"; expiring=$?; set -e
|
set +e; openssl x509 -checkend $((RENEW_DAYS * 86400)) -noout -in "${cert}"; expiring=$?; set -e
|
||||||
valid="$(openssl x509 -enddate -noout -in "${cert}" | cut -d= -f2- )"
|
valid="$(openssl x509 -enddate -noout -in "${cert}" | cut -d= -f2- )"
|
||||||
|
|
||||||
echo -n " + Valid till ${valid} "
|
echo -n " + Valid till ${valid} "
|
||||||
@@ -240,5 +241,6 @@ fi
|
|||||||
echo "(Less than ${RENEW_DAYS} days). Renewing!"
|
echo "(Less than ${RENEW_DAYS} days). Renewing!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# shellcheck disable=SC2086
|
||||||
sign_domain $line
|
sign_domain $line
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user