parent
b051c5b4e3
commit
fd6998a68f
1 changed files with 15 additions and 14 deletions
29
cd.sh
29
cd.sh
|
@ -25,6 +25,7 @@ cd_main () {
|
||||||
#
|
#
|
||||||
|
|
||||||
cd_set_environment () {
|
cd_set_environment () {
|
||||||
|
cd_step 'Set environment'
|
||||||
CD_DNS_FILE='/etc/resolv.conf'
|
CD_DNS_FILE='/etc/resolv.conf'
|
||||||
case "${CD_OS_NAME}" in
|
case "${CD_OS_NAME}" in
|
||||||
'debian')
|
'debian')
|
||||||
|
@ -86,7 +87,7 @@ cd_set_environment () {
|
||||||
cd_set_dns_resolving () {
|
cd_set_dns_resolving () {
|
||||||
local server
|
local server
|
||||||
local text=''
|
local text=''
|
||||||
cd_step "${FUNCNAME}"
|
cd_step 'Set DNS resolving'
|
||||||
for server in "${@}" ; do
|
for server in "${@}" ; do
|
||||||
text="${text}nameserver ${server}
|
text="${text}nameserver ${server}
|
||||||
"
|
"
|
||||||
|
@ -95,7 +96,7 @@ local text=''
|
||||||
}
|
}
|
||||||
|
|
||||||
cd_set_packages_repositories () {
|
cd_set_packages_repositories () {
|
||||||
cd_step "${FUNCNAME}"
|
cd_step 'Set packages repositories'
|
||||||
case "${CD_OS_NAME}" in
|
case "${CD_OS_NAME}" in
|
||||||
'debian')
|
'debian')
|
||||||
cd_write '/etc/apt/sources.list' "\
|
cd_write '/etc/apt/sources.list' "\
|
||||||
|
@ -110,7 +111,7 @@ deb https://deb.debian.org/debian-security bookworm-security main
|
||||||
}
|
}
|
||||||
|
|
||||||
cd_set_packages_configuration () {
|
cd_set_packages_configuration () {
|
||||||
cd_step "${FUNCNAME}"
|
cd_step 'Set packages configuration'
|
||||||
case "${CD_OS_NAME}" in
|
case "${CD_OS_NAME}" in
|
||||||
'debian')
|
'debian')
|
||||||
export DEBIAN_FRONTEND='noninteractive'
|
export DEBIAN_FRONTEND='noninteractive'
|
||||||
|
@ -127,7 +128,7 @@ Dir::Etc::SourceParts \"\";
|
||||||
}
|
}
|
||||||
|
|
||||||
cd_set_https_verification_off () {
|
cd_set_https_verification_off () {
|
||||||
cd_step "${FUNCNAME}"
|
cd_step 'Set HTTPS verification off'
|
||||||
case "${CD_OS_NAME}" in
|
case "${CD_OS_NAME}" in
|
||||||
'debian')
|
'debian')
|
||||||
cd_write '/etc/apt/apt.conf.d/https' "\
|
cd_write '/etc/apt/apt.conf.d/https' "\
|
||||||
|
@ -139,7 +140,7 @@ Acquire::https::Verify-Peer False;
|
||||||
}
|
}
|
||||||
|
|
||||||
cd_update_packages_catalog () {
|
cd_update_packages_catalog () {
|
||||||
cd_step "${FUNCNAME}"
|
cd_step 'Update packages catalog'
|
||||||
case "${CD_OS_NAME}" in
|
case "${CD_OS_NAME}" in
|
||||||
'debian') apt-get update || exit ;;
|
'debian') apt-get update || exit ;;
|
||||||
*) exit 1 ;;
|
*) exit 1 ;;
|
||||||
|
@ -147,7 +148,7 @@ cd_update_packages_catalog () {
|
||||||
}
|
}
|
||||||
|
|
||||||
cd_install_packages_tools () {
|
cd_install_packages_tools () {
|
||||||
cd_step "${FUNCNAME}"
|
cd_step 'Install packages tools'
|
||||||
case "${CD_OS_NAME}" in
|
case "${CD_OS_NAME}" in
|
||||||
'debian') cd_install_package 'apt-utils' ;;
|
'debian') cd_install_package 'apt-utils' ;;
|
||||||
*) exit 1 ;;
|
*) exit 1 ;;
|
||||||
|
@ -155,7 +156,7 @@ cd_install_packages_tools () {
|
||||||
}
|
}
|
||||||
|
|
||||||
cd_install_ca () {
|
cd_install_ca () {
|
||||||
cd_step "${FUNCNAME}"
|
cd_step 'Install CA'
|
||||||
case "${CD_OS_NAME}" in
|
case "${CD_OS_NAME}" in
|
||||||
'debian') cd_install_package 'ca-certificates' ;;
|
'debian') cd_install_package 'ca-certificates' ;;
|
||||||
*) exit 1 ;;
|
*) exit 1 ;;
|
||||||
|
@ -163,7 +164,7 @@ cd_install_ca () {
|
||||||
}
|
}
|
||||||
|
|
||||||
cd_set_https_verification_on () {
|
cd_set_https_verification_on () {
|
||||||
cd_step "${FUNCNAME}"
|
cd_step 'Set HTTPS verification on'
|
||||||
case "${CD_OS_NAME}" in
|
case "${CD_OS_NAME}" in
|
||||||
'debian') rm '/etc/apt/apt.conf.d/https' ;;
|
'debian') rm '/etc/apt/apt.conf.d/https' ;;
|
||||||
*) exit 1 ;;
|
*) exit 1 ;;
|
||||||
|
@ -171,7 +172,7 @@ cd_set_https_verification_on () {
|
||||||
}
|
}
|
||||||
|
|
||||||
cd_upgrade_packages () {
|
cd_upgrade_packages () {
|
||||||
cd_step "${FUNCNAME}"
|
cd_step 'Upgrade packages'
|
||||||
case "${CD_OS_NAME}" in
|
case "${CD_OS_NAME}" in
|
||||||
'debian') apt-get upgrade --yes || exit ;;
|
'debian') apt-get upgrade --yes || exit ;;
|
||||||
*) exit 1 ;;
|
*) exit 1 ;;
|
||||||
|
@ -179,7 +180,7 @@ cd_upgrade_packages () {
|
||||||
}
|
}
|
||||||
|
|
||||||
cd_install_git () {
|
cd_install_git () {
|
||||||
cd_step "${FUNCNAME}"
|
cd_step 'Install Git'
|
||||||
case "${CD_OS_NAME}" in
|
case "${CD_OS_NAME}" in
|
||||||
'debian') cd_install_package 'git' ;;
|
'debian') cd_install_package 'git' ;;
|
||||||
*) exit 1 ;;
|
*) exit 1 ;;
|
||||||
|
@ -187,7 +188,7 @@ cd_install_git () {
|
||||||
}
|
}
|
||||||
|
|
||||||
cd_install_python () {
|
cd_install_python () {
|
||||||
cd_step "${FUNCNAME}"
|
cd_step 'Install Python'
|
||||||
case "${CD_OS_NAME}" in
|
case "${CD_OS_NAME}" in
|
||||||
'debian') cd_install_package 'python3' ;;
|
'debian') cd_install_package 'python3' ;;
|
||||||
*) exit 1 ;;
|
*) exit 1 ;;
|
||||||
|
@ -195,7 +196,7 @@ cd_install_python () {
|
||||||
}
|
}
|
||||||
|
|
||||||
cd_clean_packages_cache () {
|
cd_clean_packages_cache () {
|
||||||
cd_step "${FUNCNAME}"
|
cd_step 'Clean packages cache'
|
||||||
case "${CD_OS_NAME}" in
|
case "${CD_OS_NAME}" in
|
||||||
'debian') apt-get clean || exit ;;
|
'debian') apt-get clean || exit ;;
|
||||||
*) exit 1 ;;
|
*) exit 1 ;;
|
||||||
|
@ -205,7 +206,7 @@ cd_clean_packages_cache () {
|
||||||
cd_install () {
|
cd_install () {
|
||||||
local repository
|
local repository
|
||||||
local root
|
local root
|
||||||
cd_step "${FUNCNAME}"
|
cd_step 'Install'
|
||||||
root="$(mktemp --directory)" || exit
|
root="$(mktemp --directory)" || exit
|
||||||
for repository in "${@}" ; do
|
for repository in "${@}" ; do
|
||||||
git clone \
|
git clone \
|
||||||
|
@ -219,7 +220,7 @@ local root
|
||||||
}
|
}
|
||||||
|
|
||||||
cd_bootstrap () {
|
cd_bootstrap () {
|
||||||
cd_step "${FUNCNAME}"
|
cd_step 'Bootstrap'
|
||||||
"${CD_PYTHON_COMMAND}" -m "${1}"
|
"${CD_PYTHON_COMMAND}" -m "${1}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue