This commit is contained in:
Gilles Mouchet 2026-04-30 18:33:01 +02:00
parent 0a6ef958f5
commit d186d41fc1

View File

@ -26,8 +26,8 @@ expired_date(){
shopt -u nullglob shopt -u nullglob
if [ "${#certList[@]}" -gt "0" ]; then if [ "${#certList[@]}" -gt "0" ]; then
for crtFile in "${certList[@]}"; do for crtFile in "${certList[@]}"; do
# set data from certfificate # set data from certfificate. xargs remove space at begin and end cn
cn=$(openssl x509 -noout -subject -in $crtFile | cut -d"=" -f3) cn=$(openssl x509 -noout -subject -in $crtFile | cut -d"=" -f3 | xargs)
expiration=$(openssl x509 -noout -in $crtFile -enddate | cut -d"=" -f2) expiration=$(openssl x509 -noout -in $crtFile -enddate | cut -d"=" -f2)
# convert in timestamp Unix # convert in timestamp Unix
exp=$(date -u -d "$expiration" +%s) exp=$(date -u -d "$expiration" +%s)