diff --git a/files/certbot-renewal.sh b/files/certbot-renewal.sh index 52dff70..a5d87fb 100644 --- a/files/certbot-renewal.sh +++ b/files/certbot-renewal.sh @@ -7,7 +7,7 @@ for f in `ls /etc/letsencrypt/live/ --ignore "README"` do echo Checking $f >> $log #check if cert has already expired or will expire within the next two days and renew if applicable - expires=`echo `openssl x509 -enddate -noout -in /etc/letsencrypt/live/$f/cert.pem` " - 2 day" | grep -Po "(?<=notAfter=).*" | date +%Y%m%d -f -` + expires=$(echo `openssl x509 -enddate -noout -in /etc/letsencrypt/live/$f/cert.pem` " - 2 day" | grep -Po "(?<=notAfter=).*" | date +%Y%m%d -f -) if [[ $today > $expires ]] then echo Certificate for $f is expired, renewing >> $log