old=`/usr/bin/stat -c %Y /etc/letsencrypt/live/www.site/privkey.pem`
new=`/usr/bin/stat -c %Y /home/letsencrpt/etc/letsencrypt/live/www.site/privkey.pem`
difference=`expr "$new" - "$old"`
#checking the difference whether is number
if ! [[ "$difference" =~ ^-?[0-9]+$ ]]; then
logging "Something was wrong with privkey.pem file, the script was stopped with error"
rm /home/letsencrpt/letsencrypt.tar
exit 1
fi
if [[ $difference -gt 0 ]]; then
logging "Updating certs..."
logging "Old creating date is $old, new creating date is $new"
/bin/tar xvpf /home/letsencrpt/letsencrypt.tar -C /
fi
Комментариев нет:
Отправить комментарий