Compare commits
7 commits
44b4b5b357
...
8739a7be34
Author | SHA1 | Date | |
---|---|---|---|
8739a7be34 | |||
54dd37f1c3 | |||
1998b57e89 | |||
292d5e0c9e | |||
3de8ea1b23 | |||
dac01bb13b | |||
f27e5adbd3 |
1 changed files with 43 additions and 11 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
|
||||
cd_copy_ca
|
||||
cd_update_ca
|
||||
cd_install_ca_certificates
|
||||
cd_write_ca_certificates
|
||||
cd_update_ca_certificates
|
||||
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")
|
||||
"8"|"9")
|
||||
CD_PYTHON_PACKAGE="python3.11"
|
||||
CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages"
|
||||
;;
|
||||
|
@ -112,6 +112,8 @@ local text=""
|
|||
}
|
||||
|
||||
cd_set_packages_repositories () {
|
||||
local expression
|
||||
local file
|
||||
cd_step "Set packages repositories"
|
||||
case "${CD_OS_NAME}" in
|
||||
"debian")
|
||||
|
@ -122,7 +124,11 @@ deb https://deb.debian.org/debian bookworm-updates main
|
|||
deb https://deb.debian.org/debian-security bookworm-security main
|
||||
"
|
||||
;;
|
||||
"alma") echo "TODO" ;;
|
||||
"alma")
|
||||
file="/etc/yum.repos.d/almalinux.repo"
|
||||
cd_sed "${file}" "|^m|# m|" "|^# b|b|"
|
||||
cd_cat "${file}"
|
||||
;;
|
||||
*) cd_error_os "cd_set_packages_repositories" ;;
|
||||
esac
|
||||
}
|
||||
|
@ -180,23 +186,31 @@ cd_install_packages_tools () {
|
|||
esac
|
||||
}
|
||||
|
||||
cd_install_ca () {
|
||||
cd_install_ca_certificates () {
|
||||
cd_step "Install CA"
|
||||
cd_install_package "${CD_CA_PACKAGE}"
|
||||
}
|
||||
|
||||
cd_copy_ca () {
|
||||
cd_write_ca_certificates () {
|
||||
local index
|
||||
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
|
||||
echo "TODO"
|
||||
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
|
||||
}
|
||||
|
||||
cd_update_ca () {
|
||||
cd_update_ca_certificates () {
|
||||
cd_step "Update CA"
|
||||
case "${CD_OS_NAME}" in
|
||||
"debian") update-ca-certificates || exit ;;
|
||||
|
@ -326,13 +340,31 @@ 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