From 641051ff19630f7fcaf2630dfd89354fb01cf96e Mon Sep 17 00:00:00 2001 From: LecygneNoir Date: Sat, 10 Sep 2016 17:47:16 +0200 Subject: [PATCH] add some date in the log output for better logging --- renew-certificates | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/renew-certificates b/renew-certificates index 1f73955..9f9975a 100755 --- a/renew-certificates +++ b/renew-certificates @@ -7,7 +7,7 @@ haproxy_pem_path="/etc/haproxy/cert" #Renew all certificates that needed it ${certbot_bin} renew if [ $? -eq 0 ]; then - echo "Certificates renewed ! Now creating .pem" + echo "$(date +%c)Certificates renewed ! Now creating .pem" else echo "$(date +%c) Error renewing certificates with error code $?, exit script..." exit 1 @@ -16,10 +16,11 @@ fi #Then, create domain.pem containing fullchain et privkey for haproxy for domainconf in $(ls /etc/letsencrypt/renewal/); do domain=${domainconf%.conf} - echo "create ${domain}.pem" + echo "$(date +%c)create ${domain}.pem" cat /etc/letsencrypt/live/${domain}/fullchain.pem /etc/letsencrypt/live/${domain}/privkey.pem > ${haproxy_pem_path}/${domain}.pem done # At the end, reload haproxy +echo "$(date +%c) Reload haproxy" service haproxy reload