forked from URZ/admin-tools
Fix issue with CRL in ca-certificates.crt
This commit is contained in:
14
UpdateCRL.sh
14
UpdateCRL.sh
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user