Minor changes.
This commit is contained in:
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
DATE=`date +%F-%H-%M-%S`
|
DATE=`date +%F-%H-%M-%S`
|
||||||
|
|
||||||
cd /domains
|
|
||||||
|
|
||||||
email=$EMAIL
|
email=$EMAIL
|
||||||
|
|
||||||
start_letsencrypt() {
|
start_letsencrypt() {
|
||||||
@@ -18,24 +16,24 @@ start_letsencrypt() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LETSENCRYPT_FILE=$(find . -type f -name letsencrypt);
|
LETSENCRYPT_FILE=$(find /acme.sh/ -type f -name letsencrypt);
|
||||||
if [ -n "$LETSENCRYPT_FILE" ] ; then
|
if [ -f "$LETSENCRYPT_FILE" ] ; then
|
||||||
DOMAIN=$(jq -r .DOMAIN $LETSENCRYPT_FILE) ;
|
DOMAIN=$(jq -r .DOMAIN $LETSENCRYPT_FILE) ;
|
||||||
start_letsencrypt;
|
start_letsencrypt;
|
||||||
rm $LETSENCRYPT_FILE;
|
rm $LETSENCRYPT_FILE;
|
||||||
else
|
else
|
||||||
for i in `ls` ; do
|
for i in `ls /domains/` ; do
|
||||||
DOMAIN=$(jq -r .DOMAIN $i) ;
|
DOMAIN=$(jq -r .DOMAIN /domains/$i) ;
|
||||||
if [[ -f /acme.sh/$DOMAIN/key.pem && -f /acme.sh/$DOMAIN/fullchain.pem && -f /acme.sh/$DOMAIN/cert.pem ]] ; then
|
if [[ -f "/acme.sh/$DOMAIN/key.pem" && -f "/acme.sh/$DOMAIN/fullchain.pem" && -f "/acme.sh/$DOMAIN/cert.pem" ]] ; then
|
||||||
start_letsencrypt ;
|
echo "Found certificate files";
|
||||||
if [ find /acme.sh/$DOMAIN/ -type f -mmin +60 ]; then
|
start_letsencrypt;
|
||||||
touch /acme.sh/$DOMAIN/renew_certificate;
|
if [ find /acme.sh/$DOMAIN/ -type f -mmin +60 ]; then
|
||||||
fi
|
touch /acme.sh/$DOMAIN/renew_certificate;
|
||||||
else
|
fi
|
||||||
start_letsencrypt;
|
else
|
||||||
touch /acme.sh/$DOMAIN/new_certificate;
|
start_letsencrypt;
|
||||||
fi
|
touch /acme.sh/$DOMAIN/new_certificate;
|
||||||
done ;
|
fi
|
||||||
fi
|
done ;
|
||||||
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user