Project

General

Profile

UsareLetsEncrypt » listlecert.sh

Script per elencare certificati e domini - Simone Piccardi, 05/11/2016 03:10 PM

 
1
#!/bin/bash
2

    
3
echo Certificati installati:
4
for i in /etc/letsencrypt/live/*/cert.pem; do 
5
    echo "in $i":
6
    MAIN=$(openssl x509 -text -noout < $i|grep Subject:|cut -d= -f2)
7
    echo Main CN: $MAIN
8
    ALT=$(openssl x509 -text -noout < $i | \
9
      sed -n -r '/X509v3 Subject Alternative Name:/,+1p' \
10
       | egrep -v '(Subject Public Key Info:|X509v3 Subject)' \
11
       | tr -d ',:DNS')
12
    echo Alternate: 
13
    for j in $ALT; do
14
    	echo - $j
15
    done
16
done
17

    
(2-2/2)