if inside https functions
This commit is contained in:
parent
1b1d94724b
commit
5787bf6fca
1 changed files with 22 additions and 18 deletions
40
cd.sh
40
cd.sh
|
@ -15,12 +15,12 @@ cd_main () {
|
|||
cd_set_packages_repositories
|
||||
cd_set_packages_configuration
|
||||
cd_write_ca_certificates
|
||||
[ "${CD_CA}" ] && cd_set_https_verification_off
|
||||
cd_set_https_verification_off
|
||||
cd_update_packages_catalog
|
||||
cd_install_packages_tools
|
||||
cd_install_ca_certificates
|
||||
cd_update_ca_certificates
|
||||
[ "${CD_CA}" ] && cd_set_https_verification_on
|
||||
cd_set_https_verification_on
|
||||
cd_update_packages_catalog
|
||||
cd_upgrade_packages
|
||||
cd_install_git
|
||||
|
@ -175,20 +175,22 @@ local text
|
|||
}
|
||||
|
||||
cd_set_https_verification_off () {
|
||||
cd_step "Set HTTPS verification off"
|
||||
case "${CD_OS_NAME}" in
|
||||
"debian")
|
||||
cd_write "/etc/apt/apt.conf.d/https" "\
|
||||
if [ "${CD_CA}" ] ; then
|
||||
cd_step "Set HTTPS verification off"
|
||||
case "${CD_OS_NAME}" in
|
||||
"debian")
|
||||
cd_write "/etc/apt/apt.conf.d/https" "\
|
||||
Acquire::https::Verify-Peer False;
|
||||
"
|
||||
;;
|
||||
"alma")
|
||||
cd_write "/etc/dnf/dnf.conf.d/https.conf" "\
|
||||
;;
|
||||
"alma")
|
||||
cd_write "/etc/dnf/dnf.conf.d/https.conf" "\
|
||||
sslverify=False
|
||||
"
|
||||
;;
|
||||
*) cd_error_os "cd_set_https_verification_off" ;;
|
||||
esac
|
||||
;;
|
||||
*) cd_error_os "cd_set_https_verification_off" ;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
cd_update_packages_catalog () {
|
||||
|
@ -224,12 +226,14 @@ cd_update_ca_certificates () {
|
|||
}
|
||||
|
||||
cd_set_https_verification_on () {
|
||||
cd_step "Set HTTPS verification on"
|
||||
case "${CD_OS_NAME}" in
|
||||
"debian") cd_rm "/etc/apt/apt.conf.d/https" ;;
|
||||
"alma") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;;
|
||||
*) cd_error_os "cd_set_https_verification_on" ;;
|
||||
esac
|
||||
if [ "${CD_CA}" ] ; then
|
||||
cd_step "Set HTTPS verification on"
|
||||
case "${CD_OS_NAME}" in
|
||||
"debian") cd_rm "/etc/apt/apt.conf.d/https" ;;
|
||||
"alma") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;;
|
||||
*) cd_error_os "cd_set_https_verification_on" ;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
cd_upgrade_packages () {
|
||||
|
|
Loading…
Reference in a new issue