Fix issue with CRL in ca-certificates.crt

This commit is contained in:
2023-09-20 11:05:41 +02:00
parent 86a7bd57f7
commit c98ab8361d

View File

@@ -33,7 +33,7 @@ function ERROR {
###########################################################
PATHCRL=/usr/local/share/ca-certificates
PATHCRL=/etc/ssl/crl
CRL=(UniHGW-CRL GEANT-RSA-CRL GEANT-ECC-CRL)
PATHSSL=/etc/ssl/certs
LASTRUN=/var/lib/runtime/$(basename "$0" .sh).lastrun
@@ -78,13 +78,23 @@ do
fi
# Move CRL to final destination path
if ! mv -f "/tmp/$CRL.pem" "$PATHCRL/$CRL.crt"; then
if ! mv -f "/tmp/$CRL.pem" "$PATHCRL/$CRL.pem"; then
ERROR "Could not move CRL to $PATHCRL!"
ERR=1
rm -f "/tmp/$CRL.pem"
continue
fi
# Link CRL
if [[ ! -L "$PATHSSL"/"$CRL.pem" ]]; then
if ! ln -s "$PATHCRL"/"$CRL.pem" "$PATHSSL"/"$CRL.pem"; then
ERROR "Could not create CRL link to $PATHSSL!"
ERR=1
rm -f "$PATHCRL"/"$CRL.pem" "$PATHSSL"/"$CRL.pem"
continue
fi
fi
INFO "$CRL successfully updated"
done