if inside https functions

This commit is contained in:
Marc Beninca 2024-05-02 08:38:49 +02:00
parent 1b1d94724b
commit 5787bf6fca
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

40
cd.sh
View file

@ -15,12 +15,12 @@ cd_main () {
cd_set_packages_repositories cd_set_packages_repositories
cd_set_packages_configuration cd_set_packages_configuration
cd_write_ca_certificates cd_write_ca_certificates
[ "${CD_CA}" ] && cd_set_https_verification_off cd_set_https_verification_off
cd_update_packages_catalog cd_update_packages_catalog
cd_install_packages_tools cd_install_packages_tools
cd_install_ca_certificates cd_install_ca_certificates
cd_update_ca_certificates cd_update_ca_certificates
[ "${CD_CA}" ] && cd_set_https_verification_on cd_set_https_verification_on
cd_update_packages_catalog cd_update_packages_catalog
cd_upgrade_packages cd_upgrade_packages
cd_install_git cd_install_git
@ -175,20 +175,22 @@ local text
} }
cd_set_https_verification_off () { cd_set_https_verification_off () {
cd_step "Set HTTPS verification off" if [ "${CD_CA}" ] ; then
case "${CD_OS_NAME}" in cd_step "Set HTTPS verification off"
"debian") case "${CD_OS_NAME}" in
cd_write "/etc/apt/apt.conf.d/https" "\ "debian")
cd_write "/etc/apt/apt.conf.d/https" "\
Acquire::https::Verify-Peer False; Acquire::https::Verify-Peer False;
" "
;; ;;
"alma") "alma")
cd_write "/etc/dnf/dnf.conf.d/https.conf" "\ cd_write "/etc/dnf/dnf.conf.d/https.conf" "\
sslverify=False sslverify=False
" "
;; ;;
*) cd_error_os "cd_set_https_verification_off" ;; *) cd_error_os "cd_set_https_verification_off" ;;
esac esac
fi
} }
cd_update_packages_catalog () { cd_update_packages_catalog () {
@ -224,12 +226,14 @@ cd_update_ca_certificates () {
} }
cd_set_https_verification_on () { cd_set_https_verification_on () {
cd_step "Set HTTPS verification on" if [ "${CD_CA}" ] ; then
case "${CD_OS_NAME}" in cd_step "Set HTTPS verification on"
"debian") cd_rm "/etc/apt/apt.conf.d/https" ;; case "${CD_OS_NAME}" in
"alma") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; "debian") cd_rm "/etc/apt/apt.conf.d/https" ;;
*) cd_error_os "cd_set_https_verification_on" ;; "alma") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;;
esac *) cd_error_os "cd_set_https_verification_on" ;;
esac
fi
} }
cd_upgrade_packages () { cd_upgrade_packages () {