From bb2294e76119e454f77cad5321e66502fc532b3b Mon Sep 17 00:00:00 2001 From: neil Date: Sat, 30 Jan 2016 10:39:02 +0800 Subject: [PATCH] fix issue: do not re-generate domain key when call renew command --- le.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/le.sh b/le.sh index 6bacce2f..f90ebe3e 100755 --- a/le.sh +++ b/le.sh @@ -1,5 +1,5 @@ #!/bin/bash -VER=1.1.1 +VER=1.1.2 PROJECT="https://github.com/Neilpang/le" DEFAULT_CA="https://acme-v01.api.letsencrypt.org" @@ -104,7 +104,10 @@ createDomainKey() { fi _initpath $domain - if [ -f "$CERT_KEY_PATH" ] && ! [ "$FORCE" ] ; then + if [ ! -f "$CERT_KEY_PATH" ] || ( [ "$FORCE" ] && ! [ "$IS_RENEW" ] ); then + #generate account key + openssl genrsa $length > "$CERT_KEY_PATH" + else if [ "$IS_RENEW" ] ; then _info "Domain key exists, skip" return 0 @@ -113,9 +116,6 @@ createDomainKey() { _err "Set FORCE=1, and try again." return 1 fi - else - #generate account key - openssl genrsa $length > "$CERT_KEY_PATH" fi }