Compare commits
No commits in common. "8739a7be34a4a741087bcf495edb9c53cbf76f62" and "44b4b5b3572d32410d8bd4c8b88c8ee70a562b65" have entirely different histories.
8739a7be34
...
44b4b5b357
1 changed files with 11 additions and 43 deletions
54
cd.sh
54
cd.sh
|
@ -17,9 +17,9 @@ cd_main () {
|
|||
cd_set_https_verification_off
|
||||
cd_update_packages_catalog
|
||||
cd_install_packages_tools
|
||||
cd_install_ca_certificates
|
||||
cd_write_ca_certificates
|
||||
cd_update_ca_certificates
|
||||
cd_install_ca
|
||||
cd_copy_ca
|
||||
cd_update_ca
|
||||
cd_set_https_verification_on
|
||||
cd_update_packages_catalog
|
||||
cd_upgrade_packages
|
||||
|
@ -47,7 +47,7 @@ cd_set_environment () {
|
|||
;;
|
||||
"alma")
|
||||
case "${CD_OS_VERSION}" in
|
||||
"8"|"9")
|
||||
"8")
|
||||
CD_PYTHON_PACKAGE="python3.11"
|
||||
CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages"
|
||||
;;
|
||||
|
@ -112,8 +112,6 @@ local text=""
|
|||
}
|
||||
|
||||
cd_set_packages_repositories () {
|
||||
local expression
|
||||
local file
|
||||
cd_step "Set packages repositories"
|
||||
case "${CD_OS_NAME}" in
|
||||
"debian")
|
||||
|
@ -124,11 +122,7 @@ deb https://deb.debian.org/debian bookworm-updates main
|
|||
deb https://deb.debian.org/debian-security bookworm-security main
|
||||
"
|
||||
;;
|
||||
"alma")
|
||||
file="/etc/yum.repos.d/almalinux.repo"
|
||||
cd_sed "${file}" "|^m|# m|" "|^# b|b|"
|
||||
cd_cat "${file}"
|
||||
;;
|
||||
"alma") echo "TODO" ;;
|
||||
*) cd_error_os "cd_set_packages_repositories" ;;
|
||||
esac
|
||||
}
|
||||
|
@ -186,31 +180,23 @@ cd_install_packages_tools () {
|
|||
esac
|
||||
}
|
||||
|
||||
cd_install_ca_certificates () {
|
||||
cd_install_ca () {
|
||||
cd_step "Install CA"
|
||||
cd_install_package "${CD_CA_PACKAGE}"
|
||||
}
|
||||
|
||||
cd_write_ca_certificates () {
|
||||
local index
|
||||
cd_copy_ca () {
|
||||
local target
|
||||
local text
|
||||
cd_step "Copy CA"
|
||||
case "${CD_OS_NAME}" in
|
||||
"debian") target="/usr/local/share/ca-certificates" ;;
|
||||
"alma") target="/etc/pki/ca-trust/source/anchors" ;;
|
||||
*) cd_error_os "cd_copy_ca" ;;
|
||||
esac
|
||||
index=1
|
||||
eval "text=\${CD_CA_${index}}"
|
||||
while [ "${text}" ] ; do
|
||||
cd_write "${target}/${index}.crt" "${text}"
|
||||
index=$((index+1))
|
||||
eval "text=\${CD_CA_${index}}"
|
||||
done
|
||||
echo "TODO"
|
||||
}
|
||||
|
||||
cd_update_ca_certificates () {
|
||||
cd_update_ca () {
|
||||
cd_step "Update CA"
|
||||
case "${CD_OS_NAME}" in
|
||||
"debian") update-ca-certificates || exit ;;
|
||||
|
@ -340,31 +326,13 @@ cd_rm () {
|
|||
fi
|
||||
}
|
||||
|
||||
cd_sed () {
|
||||
local expression
|
||||
local file
|
||||
if [ -f "${1}" ] ; then
|
||||
file="${1}"
|
||||
shift
|
||||
for expression in "${@}" ; do
|
||||
sed --in-place "s${expression}g" "${file}" || exit
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
cd_split () {
|
||||
echo -n "\
|
||||
╶─╌╌┄┄┈┈
|
||||
"
|
||||
}
|
||||
|
||||
cd_step () {
|
||||
if [ "${1}" ] ; then
|
||||
CD_STEP=$((CD_STEP+1))
|
||||
echo -n "\
|
||||
╭─╌╌┄┄┈┈
|
||||
╭─╌┄┈
|
||||
│ ${CD_STEP} ${1}
|
||||
╰─╌╌┄┄┈┈
|
||||
╰─╌┄┈
|
||||
"
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue