mirror of
https://github.com/myvesta/vesta
synced 2025-08-13 01:57:57 -07:00
*Check for letsencrypt by the LETSENCRYPT object, not the cert metadata
This commit is contained in:
parent
040f4192a7
commit
50f1db1abf
1 changed files with 20 additions and 22 deletions
|
@ -28,11 +28,10 @@ users=$(ls $VESTA/data/users/*/ssl/le.conf |cut -f 7 -d /)
|
|||
# Checking users
|
||||
for user in $users; do
|
||||
# Checking user certificates
|
||||
for crt in $(ls $VESTA/data/users/$user/ssl/*.crt 2>/dev/null); do
|
||||
for domain in $(search_objects 'web' 'LETSENCRYPT' 'yes' 'DOMAIN'); do
|
||||
# Checking certificate issuer
|
||||
crt_data=$(openssl x509 -text -in $crt)
|
||||
issuer=$(echo "$crt_data" |grep Issuer: |grep Encrypt)
|
||||
if [ ! -z "$issuer" ]; then
|
||||
crt_data=$(openssl x509 -text -in "$VESTA/data/users/$user/ssl/$domain.crt")
|
||||
|
||||
expire=$(echo "$crt_data" |grep "Not After")
|
||||
expire=$(echo "$expire" |cut -f 2,3,4 -d :)
|
||||
expire=$(date -d "$expire" +%s)
|
||||
|
@ -52,7 +51,6 @@ for user in $users; do
|
|||
$BIN/v-add-letsencrypt-domain $user $domain
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue