fixed expires variable
This commit is contained in:
parent
23fb4cec18
commit
abfbe73186
1 changed files with 1 additions and 1 deletions
|
@ -7,7 +7,7 @@ for f in `ls /etc/letsencrypt/live/ --ignore "README"`
|
||||||
do
|
do
|
||||||
echo Checking $f >> $log
|
echo Checking $f >> $log
|
||||||
#check if cert has already expired or will expire within the next two days and renew if applicable
|
#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 ]]
|
if [[ $today > $expires ]]
|
||||||
then
|
then
|
||||||
echo Certificate for $f is expired, renewing >> $log
|
echo Certificate for $f is expired, renewing >> $log
|
||||||
|
|
Loading…
Add table
Reference in a new issue