This commit is contained in:
Marc Beninca 2024-05-02 10:19:18 +02:00
parent b3adfe3182
commit 0cb9952b32
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

24
cd.sh
View file

@ -8,7 +8,7 @@ cd \
rwx \ rwx \
" "
# steps # main
cd_main () { cd_main () {
cd_set_environment cd_set_environment
cd_set_dns_resolving ${CD_DNS} cd_set_dns_resolving ${CD_DNS}
@ -30,7 +30,7 @@ cd_main () {
cd_execute_python_module ${CD_PYTHON_MODULES} cd_execute_python_module ${CD_PYTHON_MODULES}
} }
# functions # steps
cd_set_environment () { cd_set_environment () {
local variable local variable
@ -43,6 +43,10 @@ local variable
# #
case "${CD_OS_NAME}" in case "${CD_OS_NAME}" in
"debian") "debian")
case "${CD_OS_VERSION}" in
"bookworm"|"bullseye") cd_nop ;;
*) cd_error_os "CD_OS_VERSION=${CD_OS_VERSION}" ;;
esac
CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGE="python3"
CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages"
CD_CA_ROOT="/usr/local/share/ca-certificates" CD_CA_ROOT="/usr/local/share/ca-certificates"
@ -114,10 +118,10 @@ local file
case "${CD_OS_NAME}" in case "${CD_OS_NAME}" in
"debian") "debian")
cd_write "/etc/apt/sources.list" "\ cd_write "/etc/apt/sources.list" "\
deb https://deb.debian.org/debian bookworm main deb https://deb.debian.org/debian ${CD_OS_VERSION} main
deb https://deb.debian.org/debian bookworm-backports main deb https://deb.debian.org/debian ${CD_OS_VERSION}-backports main
deb https://deb.debian.org/debian bookworm-updates main deb https://deb.debian.org/debian ${CD_OS_VERSION}-updates main
deb https://deb.debian.org/debian-security bookworm-security main deb https://deb.debian.org/debian-security ${CD_OS_VERSION}-security main
" "
;; ;;
"alma") "alma")
@ -287,7 +291,7 @@ ${1}
"${CD_PYTHON_COMMAND}" -m "${1}" "${CD_STEP}" "${self}" "${CD_PYTHON_COMMAND}" -m "${1}" "${CD_STEP}" "${self}"
} }
# tools # functions
cd_cat () { cd_cat () {
if [ -f "${1}" ] ; then if [ -f "${1}" ] ; then
@ -330,6 +334,10 @@ cd_mkdir () {
fi fi
} }
cd_nop () {
true
}
cd_rm () { cd_rm () {
if [ -e "${1}" ] ; then if [ -e "${1}" ] ; then
echo "$(realpath "${1}")" echo "$(realpath "${1}")"
@ -377,5 +385,5 @@ local text="${2}"
fi fi
} }
# main # run
cd_main cd_main