diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 6be0638..0268849 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -1004,55 +1004,6 @@ spcd_f_pm_clean() { esac } -spcd_f_pm_https_path() { - case "${SPCD_PM}" in - "${SPCD_PM_APK}") echo "/etc/apk/repositories.d/https" ;; - "${SPCD_PM_APT}") echo "/etc/apt/apt.conf.d/https" ;; - "${SPCD_PM_DNF}") echo "/etc/dnf/dnf.conf.d/https.conf" ;; - "${SPCD_PM_PACMAN}") echo "/etc/pacman.d/https.conf" ;; - "${SPCD_PM_ZYPPER}") ;; - *) ;; - esac -} - -spcd_f_pm_https_trust() { - spcd_step "Trust" - local path text - if [ -n "${SPCD_CA_1}" ] || [ "${SPCD_PM}" = "${SPCD_PM_APT}" ]; then - path="$(spcd_f_pm_https_path)" - if [ -n "${path}" ]; then - spcd_os_mkdir "$(dirname "${path}")" - case "${SPCD_PM}" in - "${SPCD_PM_APK}") text="\ ---no-verify -" ;; - "${SPCD_PM_APT}") text="\ -Acquire::https::Verify-Peer False; -" ;; - "${SPCD_PM_DNF}") text="\ -sslverify=False -" ;; - "${SPCD_PM_PACMAN}") text="\ -SSLVerify = No -" ;; - "${SPCD_PM_ZYPPER}") ;; - *) ;; - esac - [ -n "${text}" ] && - spcd_os_write "${path}" "${text}" - fi - fi -} - -spcd_f_pm_https_verify() { - spcd_step "Verify" - local path - path="$(spcd_f_pm_https_path)" - if [ -n "${path}" ]; then - spcd_os_rm "${path}" - fi -} - spcd_f_pm_install() { case "${SPCD_PM}" in "${SPCD_PM_APK}") spcd_run apk add "${1}" ;; @@ -1104,6 +1055,54 @@ spcd_f_pm_upgrade() { # │ f │ pm │ https │ # ╰───┴────┴───────╯ +spcd_f_pm_https_path() { + case "${SPCD_PM}" in + "${SPCD_PM_APK}") echo "/etc/apk/repositories.d/https" ;; + "${SPCD_PM_APT}") echo "/etc/apt/apt.conf.d/https" ;; + "${SPCD_PM_DNF}") echo "/etc/dnf/dnf.conf.d/https.conf" ;; + "${SPCD_PM_PACMAN}") echo "/etc/pacman.d/https.conf" ;; + "${SPCD_PM_ZYPPER}") ;; + *) ;; + esac +} + +spcd_f_pm_https_trust() { + spcd_step "Trust" + local path text + if [ -n "${SPCD_CA_1}" ] || [ "${SPCD_PM}" = "${SPCD_PM_APT}" ]; then + path="$(spcd_f_pm_https_path)" + if [ -n "${path}" ]; then + spcd_os_mkdir "$(dirname "${path}")" + case "${SPCD_PM}" in + "${SPCD_PM_APK}") text="\ +--no-verify +" ;; + "${SPCD_PM_APT}") text="\ +Acquire::https::Verify-Peer False; +" ;; + "${SPCD_PM_DNF}") text="\ +sslverify=False +" ;; + "${SPCD_PM_PACMAN}") text="\ +SSLVerify = No +" ;; + "${SPCD_PM_ZYPPER}") ;; + *) ;; + esac + [ -n "${text}" ] && + spcd_os_write "${path}" "${text}" + fi + fi +} + +spcd_f_pm_https_verify() { + spcd_step "Verify" + local path + path="$(spcd_f_pm_https_path)" + if [ -n "${path}" ]; then + spcd_os_rm "${path}" + fi +} # ╭───┬─────╮ # │ s │ dns │