From 288f1a3101559f18c69bdd9944f2d07499aa78ac Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 21:24:41 +0200 Subject: [PATCH] https --- cd.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cd.sh b/cd.sh index 60f3343..93ca732 100644 --- a/cd.sh +++ b/cd.sh @@ -67,6 +67,7 @@ cd_set_environment_variables () { CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" CD_CMD_CLEAN="dnf clean all" CD_CMD_UPGRADE="dnf upgrade --assumeyes" + CD_FILE_HTTPS="/etc/dnf/dnf.conf.d/https.conf" CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" @@ -81,6 +82,7 @@ cd_set_environment_variables () { CD_CA_ROOT="/usr/local/share/ca-certificates" CD_CMD_CLEAN="apt-get clean" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" + CD_FILE_HTTPS="/etc/apt/apt.conf.d/https" CD_PYTHON_COMMAND="python3" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" @@ -186,12 +188,12 @@ cd_set_https_verification_off () { cd_step "Set HTTPS verification off" case "${CD_OS_ID}" in "${CD_OS_ALMA}") - cd_write "/etc/dnf/dnf.conf.d/https.conf" "\ + cd_write "${CD_FILE_HTTPS}" "\ sslverify=False " ;; "${CD_OS_DEBIAN}") - cd_write "/etc/apt/apt.conf.d/https" "\ + cd_write "${CD_FILE_HTTPS}" "\ Acquire::https::Verify-Peer False; " ;; @@ -242,18 +244,15 @@ cd_update_ca_certificates () { esac } +# agnostic steps + cd_set_https_verification_on () { if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then cd_step "Set HTTPS verification on" - case "${CD_OS_ID}" in - "${CD_OS_ALMA}") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; - "${CD_OS_DEBIAN}") cd_rm "/etc/apt/apt.conf.d/https" ;; - esac + cd_rm "${CD_FILE_HTTPS}" fi } -# agnostic steps - cd_upgrade_packages () { cd_step "Upgrade packages" ${CD_CMD_UPGRADE} || exit