From 4ca9bc799df11b247cbc48c1c0d964e0a688b462 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 29 Dec 2015 20:01:39 +0800 Subject: [PATCH 1/3] clear code --- le.sh | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/le.sh b/le.sh index d6155e8a..7bfbd369 100755 --- a/le.sh +++ b/le.sh @@ -478,14 +478,7 @@ renew() { fi DOMAIN_CONF=$WORKING_DIR/$Le_Domain/$Le_Domain.conf - if [ -f "$DOMAIN_CONF" ] ; then - source "$DOMAIN_CONF" - if [ "$(date -u "+%s" )" -lt "$Le_NextRenewTime" ] ; then - _info "Skip, Next renwal time is: $Le_NextRenewTimeStr" - return 2 - fi - fi - + if [ -z "$Le_Webroot" ] ; then echo Le_Webroot can not found, please remove the conf file and issue a new cert return 1 @@ -500,6 +493,25 @@ renewAll() { for d in $(ls -F $WORKING_DIR | grep '/$') ; do d=$(echo $d | cut -d '/' -f 1) _info "renew $d" + + Le_LinkCert="" + Le_Domain="" + Le_Alt="" + Le_Webroot="" + Le_Keylength="" + Le_LinkIssuer="" + + Le_CertCreateTime="" + Le_CertCreateTimeStr="" + Le_RenewalDays="" + Le_NextRenewTime="" + Le_NextRenewTimeStr="" + + Le_RealCertPath="" + Le_RealKeyPath="" + + Le_ReloadCmd="" + renew "$d" done From e2e275f24e333a18e27596fb1d5d7f7e46dfc7f5 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 29 Dec 2015 21:32:45 +0800 Subject: [PATCH 2/3] minor --- le.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/le.sh b/le.sh index 7bfbd369..2bfafe64 100755 --- a/le.sh +++ b/le.sh @@ -476,14 +476,7 @@ renew() { echo Usage: $0 domain.com return 1 fi - - DOMAIN_CONF=$WORKING_DIR/$Le_Domain/$Le_Domain.conf - if [ -z "$Le_Webroot" ] ; then - echo Le_Webroot can not found, please remove the conf file and issue a new cert - return 1 - fi - issue $Le_Domain } From ebb4363394d2bbd2ab4edb098f95f706ca41280c Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 29 Dec 2015 21:37:16 +0800 Subject: [PATCH 3/3] minor --- le.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/le.sh b/le.sh index 2bfafe64..d113ee93 100755 --- a/le.sh +++ b/le.sh @@ -254,7 +254,7 @@ issue() { DOMAIN_CONF=$WORKING_DIR/$Le_Domain/$Le_Domain.conf if [ -f "$DOMAIN_CONF" ] ; then source "$DOMAIN_CONF" - if [ -z "$FORCE" ] && [ "$(date -u "+%s" )" -lt "$Le_NextRenewTime" ] ; then + if [ -z "$FORCE" ] && [ "$Le_NextRenewTime" ] && [ "$(date -u "+%s" )" -lt "$Le_NextRenewTime" ] ; then _info "Skip, Next renwal time is: $Le_NextRenewTimeStr" return 2 fi