This commit is contained in:
Marc Beninca 2024-06-24 10:59:41 +02:00
parent 0dbbaaab69
commit de370d346d
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

32
pidd.sh
View file

@ -83,7 +83,7 @@ pidd_set_environment_variables() {
"${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}") "${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}")
PIDD_OS_VERSION="$(pidd_grep_os VERSION_CODENAME)" PIDD_OS_VERSION="$(pidd_grep_os VERSION_CODENAME)"
;; ;;
*) *) ;;
esac esac
# check operating system version # check operating system version
case "${PIDD_OS_ID}" in case "${PIDD_OS_ID}" in
@ -123,7 +123,7 @@ pidd_set_environment_variables() {
*) pidd_error_os "PIDD_OS_VERSION" ;; *) pidd_error_os "PIDD_OS_VERSION" ;;
esac esac
;; ;;
*) *) ;;
esac esac
pidd_split pidd_split
pidd_echo "PIDD_OS_ID" "PIDD_OS_VERSION" pidd_echo "PIDD_OS_ID" "PIDD_OS_VERSION"
@ -154,7 +154,7 @@ pidd_set_environment_variables() {
PIDD_CA_ROOT="/usr/local/share/ca-certificates" PIDD_CA_ROOT="/usr/local/share/ca-certificates"
PIDD_CMD_CA="update-ca-certificates" PIDD_CMD_CA="update-ca-certificates"
;; ;;
*) *) ;;
esac esac
pidd_split pidd_split
pidd_echo "PIDD_CA_ROOT" "PIDD_CMD_CA" pidd_echo "PIDD_CA_ROOT" "PIDD_CMD_CA"
@ -172,7 +172,7 @@ pidd_set_environment_variables() {
"${PIDD_OS_ARCH}") "${PIDD_OS_ARCH}")
PIDD_PM="${PIDD_PM_PACMAN}" PIDD_PM="${PIDD_PM_PACMAN}"
;; ;;
*) *) ;;
esac esac
pidd_split pidd_split
pidd_echo "PIDD_PM" pidd_echo "PIDD_PM"
@ -246,7 +246,7 @@ Dir::Etc::SourceParts \"\";
Acquire::https::Verify-Peer False; Acquire::https::Verify-Peer False;
" "
;; ;;
*) *) ;;
esac esac
pidd_split pidd_split
pidd_echo "PIDD_PM_CLEAN" \ pidd_echo "PIDD_PM_CLEAN" \
@ -276,7 +276,7 @@ Acquire::https::Verify-Peer False;
"${PIDD_OS_UBUNTU}") "${PIDD_OS_UBUNTU}")
PIDD_URL_DEFAULT="http://archive.ubuntu.com/ubuntu" PIDD_URL_DEFAULT="http://archive.ubuntu.com/ubuntu"
;; ;;
*) *) ;;
esac esac
PIDD_URL_CHOSEN="${PIDD_URL_DEFAULT}" PIDD_URL_CHOSEN="${PIDD_URL_DEFAULT}"
case "${PIDD_OS_ID}" in case "${PIDD_OS_ID}" in
@ -305,7 +305,7 @@ Acquire::https::Verify-Peer False;
[ -n "${PIDD_URL_UBUNTU}" ] && PIDD_URL_CHOSEN="${PIDD_URL_UBUNTU}" \ [ -n "${PIDD_URL_UBUNTU}" ] && PIDD_URL_CHOSEN="${PIDD_URL_UBUNTU}" \
|| PIDD_URL_CHOSEN="https://ubuntu.mirrors.ovh.net/ubuntu" || PIDD_URL_CHOSEN="https://ubuntu.mirrors.ovh.net/ubuntu"
;; ;;
*) *) ;;
esac esac
pidd_split pidd_split
pidd_echo "PIDD_URL_DEFAULT" "PIDD_URL_CHOSEN" pidd_echo "PIDD_URL_DEFAULT" "PIDD_URL_CHOSEN"
@ -327,7 +327,7 @@ Acquire::https::Verify-Peer False;
case "${PIDD_OS_VERSION}" in case "${PIDD_OS_VERSION}" in
"bookworm") PIDD_PYTHON_COMMAND="python3.11" ;; "bookworm") PIDD_PYTHON_COMMAND="python3.11" ;;
"bullseye") PIDD_PYTHON_COMMAND="python3.9" ;; "bullseye") PIDD_PYTHON_COMMAND="python3.9" ;;
*) *) ;;
esac esac
PIDD_PYTHON_PACKAGE="python3" PIDD_PYTHON_PACKAGE="python3"
;; ;;
@ -339,11 +339,11 @@ Acquire::https::Verify-Peer False;
case "${PIDD_OS_VERSION}" in case "${PIDD_OS_VERSION}" in
"noble") PIDD_PYTHON_COMMAND="python3.12" ;; "noble") PIDD_PYTHON_COMMAND="python3.12" ;;
"jammy") PIDD_PYTHON_COMMAND="python3.10" ;; "jammy") PIDD_PYTHON_COMMAND="python3.10" ;;
*) *) ;;
esac esac
PIDD_PYTHON_PACKAGE="python3" PIDD_PYTHON_PACKAGE="python3"
;; ;;
*) *) ;;
esac esac
# set python packages # set python packages
case "${PIDD_OS_ID}" in case "${PIDD_OS_ID}" in
@ -356,7 +356,7 @@ Acquire::https::Verify-Peer False;
"${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}") "${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}")
PIDD_PYTHON_PACKAGES="/usr/lib/${PIDD_PYTHON_ALIAS}/dist-packages" PIDD_PYTHON_PACKAGES="/usr/lib/${PIDD_PYTHON_ALIAS}/dist-packages"
;; ;;
*) *) ;;
esac esac
pidd_split pidd_split
pidd_echo "PIDD_PYTHON_COMMAND" "PIDD_PYTHON_PACKAGE" "PIDD_PYTHON_PACKAGES" pidd_echo "PIDD_PYTHON_COMMAND" "PIDD_PYTHON_PACKAGE" "PIDD_PYTHON_PACKAGES"
@ -439,7 +439,7 @@ Acquire::https::Verify-Peer False;
"${PIDD_PM_APK}"|"${PIDD_PM_APT}") PIDD_PKG_SSH="openssh-client" ;; "${PIDD_PM_APK}"|"${PIDD_PM_APT}") PIDD_PKG_SSH="openssh-client" ;;
"${PIDD_PM_DNF}") PIDD_PKG_SSH="openssh-clients" ;; "${PIDD_PM_DNF}") PIDD_PKG_SSH="openssh-clients" ;;
"${PIDD_PM_PACMAN}") PIDD_PKG_SSH="openssh" ;; "${PIDD_PM_PACMAN}") PIDD_PKG_SSH="openssh" ;;
*) *) ;;
esac esac
} }
@ -450,7 +450,7 @@ pidd_set_packages_repositories() {
case "${PIDD_OS_VERSION}" in case "${PIDD_OS_VERSION}" in
"8") pidd_spr__file="/etc/yum.repos.d/almalinux.repo" ;; "8") pidd_spr__file="/etc/yum.repos.d/almalinux.repo" ;;
"9") pidd_spr_file="/etc/yum.repos.d/almalinux-baseos.repo" ;; "9") pidd_spr_file="/etc/yum.repos.d/almalinux-baseos.repo" ;;
*) *) ;;
esac esac
pidd_sed "${pidd_spr__file}" \ pidd_sed "${pidd_spr__file}" \
"|^mirrorlist|# mirrorlist|" \ "|^mirrorlist|# mirrorlist|" \
@ -477,7 +477,7 @@ deb ${PIDD_URL_CHOSEN}-security ${PIDD_OS_VERSION}-security main
case "${PIDD_OS_VERSION}" in case "${PIDD_OS_VERSION}" in
"8") pidd_spr__file="/etc/yum.repos.d/Rocky-BaseOS.repo" ;; "8") pidd_spr__file="/etc/yum.repos.d/Rocky-BaseOS.repo" ;;
"9") pidd_spr__file="/etc/yum.repos.d/rocky.repo" ;; "9") pidd_spr__file="/etc/yum.repos.d/rocky.repo" ;;
*) *) ;;
esac esac
pidd_sed "${pidd_spr__file}" \ pidd_sed "${pidd_spr__file}" \
"|^mirrorlist|# mirrorlist|" \ "|^mirrorlist|# mirrorlist|" \
@ -493,7 +493,7 @@ deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-updates main
deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-security main deb ${PIDD_URL_CHOSEN} ${PIDD_OS_VERSION}-security main
" "
;; ;;
*) *) ;;
esac esac
} }
@ -504,7 +504,7 @@ pidd_set_packages_configuration() {
"${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}") "${PIDD_OS_DEBIAN}"|"${PIDD_OS_UBUNTU}")
export DEBIAN_FRONTEND="noninteractive" export DEBIAN_FRONTEND="noninteractive"
;; ;;
*) *) ;;
esac esac
} }