diff --git a/cd.sh b/cd.sh index a61e8ef..f0bd9d2 100644 --- a/cd.sh +++ b/cd.sh @@ -178,20 +178,21 @@ Dir::Etc::SourceParts \"\"; } cd_set_https_verification_off () { - [ "${CD_CA}" ] || [ "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] || exit - cd_step "Set HTTPS verification off" - case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") - cd_write "/etc/apt/apt.conf.d/https" "\ + if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then + cd_step "Set HTTPS verification off" + case "${CD_OS_ID}" in + "${CD_OS_DEBIAN}") + cd_write "/etc/apt/apt.conf.d/https" "\ Acquire::https::Verify-Peer False; " - ;; - "${CD_OS_ALMA}") - cd_write "/etc/dnf/dnf.conf.d/https.conf" "\ + ;; + "${CD_OS_ALMA}") + cd_write "/etc/dnf/dnf.conf.d/https.conf" "\ sslverify=False " - ;; - esac + ;; + esac + fi } cd_update_packages_catalog () { @@ -238,12 +239,13 @@ cd_update_ca_certificates () { } cd_set_https_verification_on () { - [ "${CD_CA}" ] || [ "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] || exit - cd_step "Set HTTPS verification on" - case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") cd_rm "/etc/apt/apt.conf.d/https" ;; - "${CD_OS_ALMA}") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; - esac + if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then + cd_step "Set HTTPS verification on" + case "${CD_OS_ID}" in + "${CD_OS_DEBIAN}") cd_rm "/etc/apt/apt.conf.d/https" ;; + "${CD_OS_ALMA}") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; + esac + fi } cd_upgrade_packages () {