Improve ssl cert symlinking
This commit is contained in:
27
installJRMC
27
installJRMC
@@ -737,19 +737,28 @@ runCreaterepo() {
|
|||||||
|
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Symlink certificates where JRiver Media Center expects them to be on Fedora/CentOS
|
# Symlink certificates if they do not exist in default location
|
||||||
#######################################
|
#######################################
|
||||||
symlinkCerts() {
|
symlinkCerts() {
|
||||||
debug "Running: ${FUNCNAME[0]}"
|
debug "Running: ${FUNCNAME[0]}"
|
||||||
|
|
||||||
if [[ ! -f /etc/ssl/certs/ca-certificates.crt &&
|
declare mc_cert_link="/usr/lib/jriver/Media Center $MVERSION/ca-certificates.crt"
|
||||||
-f /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem ]]; then
|
declare target_cert ln_cmd
|
||||||
debug "ln -s /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /etc/ssl/certs/ca-certificates.crt"
|
|
||||||
if ! sudo ln -s /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem \
|
target_cert=$(readlink -f "$mc_cert_link")
|
||||||
/etc/ssl/certs/ca-certificates.crt; then
|
|
||||||
err "Symlinking certificates failed"
|
[[ -f $target_cert ]] && return 0
|
||||||
return 1
|
|
||||||
fi
|
if [[ -f /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem ]]; then
|
||||||
|
ln_cmd="sudo ln -fs /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem $mc_cert_link" # For RHEL
|
||||||
|
elif [[ -f /var/lib/ca-certificates/ca-bundle.pem ]]; then
|
||||||
|
ln_cmd="sudo ln -fs /var/lib/ca-certificates/ca-bundle.pem $mc_cert_link" # For SUSE
|
||||||
|
fi
|
||||||
|
|
||||||
|
debug "$ln_cmd" || cr_cmd+=" &>/dev/null"
|
||||||
|
if ! eval "$ln_cmd"; then
|
||||||
|
err "Symlinking certificates failed"
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user