From 91e715f5cf9e569f033c63d509075ffaa39d064f Mon Sep 17 00:00:00 2001 From: gyurix Date: Mon, 28 Mar 2022 09:28:19 +0000 Subject: [PATCH] Checking some file creating path and some cycle end --- start.letsencrypt.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/start.letsencrypt.sh b/start.letsencrypt.sh index 0c40fce..2adc024 100755 --- a/start.letsencrypt.sh +++ b/start.letsencrypt.sh @@ -22,14 +22,15 @@ start_letsencrypt() { LETSENCRYPT_FILE=$(find /acme.sh/ -type f -name letsencrypt); if [ -n "$LETSENCRYPT_FILE" ] ; then DOMAIN=$(jq -r .DOMAIN $LETSENCRYPT_FILE) ; - start_letsencrypt; + start_letsencryp $DOMAIN; rm $LETSENCRYPT_FILE; + touch /acme.sh/$DOMAIN/renew_certificate; else cd /domains for i in `ls` ; do DOMAIN=$(jq -r .DOMAIN $i) ; if [[ -f /acme.sh/$DOMAIN/key.pem && -f /acme.sh/$DOMAIN/fullchain.pem && -f /acme.sh/$DOMAIN/cert.pem ]] ; then - start_letsencrypt ; + start_letsencrypt $DOMAIN; touch /acme.sh/$DOMAIN/renew_certificate; else start_letsencrypt; @@ -39,7 +40,10 @@ else else while [[ ! -f /acme.sh/$DOMAIN/key.pem || ! -f /acme.sh/$DOMAIN/fullchain.pem || ! -f /acme.sh/$DOMAIN/cert.pem ]] ; do sleep 10; - start_letsencrypt ; + start_letsencrypt $DOMAIN; + if [[ -f /acme.sh/$DOMAIN/key.pem && -f /acme.sh/$DOMAIN/fullchain.pem && -f /acme.sh/$DOMAIN/cert.pem ]] ; then + touch /acme.sh/$DOMAIN/new_certificate; + fi done fi fi