diff --git a/resources/com/cadoles/common/add-letsencrypt-ca.sh b/resources/com/cadoles/common/add-letsencrypt-ca.sh old mode 100644 new mode 100755 index efda172..b71fb54 --- a/resources/com/cadoles/common/add-letsencrypt-ca.sh +++ b/resources/com/cadoles/common/add-letsencrypt-ca.sh @@ -2,10 +2,18 @@ set -eo pipefail -DESTDIR=/usr/local/share/ca-certificates -if [ ! -d "$DESTDIR" ]; then - DESTDIR=/etc/ca-certificates/trust-source/anchors -fi +declare -a DESTDIR_PATHS=( + "/usr/local/share/ca-certificates" + "/etc/ca-certificates/trust-source/anchors" + "/etc/pki/ca-trust/source/anchors" +) + +for path in "${DESTDIR_PATHS[@]}"; do + if [ -d "$path" ]; then + DESTDIR=$path + break + fi +done UPDATE_CERTS_CMD=update-ca-certificates if [ -z "$(which $UPDATE_CERTS_CMD)" ]; then