1
0
Fork 0

Setting better log

This commit is contained in:
Joao M 2022-08-20 16:38:38 +00:00
parent defa564601
commit e63f41def1
5 changed files with 27 additions and 10 deletions

View file

@ -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