From: Lukas Schauer Date: Fri, 5 Feb 2016 14:58:01 +0000 (+0100) Subject: check if privkey exists and is readable instead of checking if it's a regular file... X-Git-Tag: v0.1.0~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c18948323f379d095bcb1310be62729cf36acda;p=thirdparty%2Fdehydrated.git check if privkey exists and is readable instead of checking if it's a regular file (fixes #122) --- diff --git a/letsencrypt.sh b/letsencrypt.sh index cd2e4f4..51b0fd3 100755 --- a/letsencrypt.sh +++ b/letsencrypt.sh @@ -465,7 +465,7 @@ sign_domain() { privkey="privkey.pem" # generate a new private key if we need or want one - if [[ ! -f "${BASEDIR}/certs/${domain}/privkey.pem" ]] || [[ "${PRIVATE_KEY_RENEW}" = "yes" ]]; then + if [[ ! -r "${BASEDIR}/certs/${domain}/privkey.pem" ]] || [[ "${PRIVATE_KEY_RENEW}" = "yes" ]]; then echo " + Generating private key..." privkey="privkey-${timestamp}.pem" case "${KEY_ALGO}" in