Setting better log
This commit is contained in:
parent
defa564601
commit
e63f41def1
5 changed files with 27 additions and 10 deletions
|
|
@ -1,12 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
source /scripts/functions.sh
|
||||
|
||||
if [ ! -f /scripts/letsencrypt_hosts.txt ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Semaphore
|
||||
if [ -f /tmp/certbot-lock ]; then
|
||||
echo "[CERTBOT_JOB] $(date +"$EASYHAPROXY_DATEFORMAT") Another process is running"
|
||||
log "notice" "CERTBOT_JOB" "Another process is running"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
|
@ -30,7 +32,7 @@ for domain in $(cat /scripts/letsencrypt_hosts.txt); do
|
|||
done
|
||||
|
||||
if [ -n "$REQUEST_CERTS" ]; then
|
||||
echo "[CERTBOT_JOB] $(date +"$EASYHAPROXY_DATEFORMAT") Requesting certificates for $REQUEST_CERTS"
|
||||
log "info" "CERTBOT_JOB" "Requesting certificates for $REQUEST_CERTS"
|
||||
certbot certonly \
|
||||
--standalone \
|
||||
--preferred-challenges http \
|
||||
|
|
@ -45,7 +47,7 @@ if [ -n "$REQUEST_CERTS" ]; then
|
|||
fi
|
||||
|
||||
if [ -n "$RENEW_CERTS" ]; then
|
||||
echo "[CERTBOT_JOB] $(date +"$EASYHAPROXY_DATEFORMAT") Resquesting renew certificated fort $RENEW_CERTS"
|
||||
log "info" "CERTBOT_JOB" "Resquesting renew certificated fort $RENEW_CERTS"
|
||||
certbot renew --post-hook "/scripts/certbot_to_haproxy.sh"
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue