autorenew LetsEncrypt SSL

This commit is contained in:
Serghey Rodin 2016-11-22 16:35:10 +02:00
commit da6ed8057f
2 changed files with 10 additions and 3 deletions

View file

@ -30,10 +30,9 @@ for user in $users; do
USER_DATA=$VESTA/data/users/$user
# Checking user certificates
for domain in $(search_objects 'web' 'LETSENCRYPT' 'yes' 'DOMAIN'); do
crt="$VESTA/data/users/$user/ssl/$domain.crt"
# Checking certificate issuer
crt_data=$(openssl x509 -text -in "$crt")
crt="$VESTA/data/users/$user/ssl/$domain.crt"
crt_data=$(openssl x509 -text -in "$crt")
expire=$(echo "$crt_data" |grep "Not After")
expire=$(echo "$expire" |cut -f 2,3,4 -d :)
expire=$(date -d "$expire" +%s)