Compare commits
2 Commits
3743865892
...
7c39356bfa
Author | SHA1 | Date | |
---|---|---|---|
7c39356bfa | |||
ae17f1fecb |
@@ -1,7 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
DATE=`date +%F-%H-%M-%S`
|
|
||||||
|
|
||||||
email=$EMAIL
|
email=$EMAIL
|
||||||
|
|
||||||
start_letsencrypt() {
|
start_letsencrypt() {
|
||||||
@@ -17,23 +15,29 @@ start_letsencrypt() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LETSENCRYPT_FILE=$(find /acme.sh/ -type f -name letsencrypt);
|
LETSENCRYPT_FILE=$(find /acme.sh/ -type f -name letsencrypt);
|
||||||
if [ -f "$LETSENCRYPT_FILE" ] ; then
|
if [ -n "$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 /domains/` ; do
|
for i in `ls` ; do
|
||||||
DOMAIN=$(jq -r .DOMAIN /domains/$i) ;
|
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
|
if [[ -f /acme.sh/$DOMAIN/key.pem && -f /acme.sh/$DOMAIN/fullchain.pem && -f /acme.sh/$DOMAIN/cert.pem ]] ; then
|
||||||
echo "Found certificate files";
|
|
||||||
start_letsencrypt ;
|
start_letsencrypt ;
|
||||||
if [[ -n "$(find /acme.sh/$DOMAIN/ -type f -mmin +60)" ]]; then
|
|
||||||
touch /acme.sh/$DOMAIN/renew_certificate;
|
touch /acme.sh/$DOMAIN/renew_certificate;
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
start_letsencrypt;
|
start_letsencrypt;
|
||||||
|
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;
|
touch /acme.sh/$DOMAIN/new_certificate;
|
||||||
|
|
||||||
|
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 ;
|
||||||
|
done
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done ;
|
done ;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user