This commit is contained in:
Marc Beninca 2024-06-24 11:44:21 +02:00
parent 3a5a670311
commit 736a0174ed
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

81
pidd.sh
View file

@ -72,56 +72,53 @@ pidd_set_environment_variables() {
esac esac
# set operating system version # set operating system version
case "${PIDD_OS_ID}" in case "${PIDD_OS_ID}" in
"${PIDD_OS_ALMA}" | "${PIDD_OS_ARCH}" | "${PIDD_OS_FEDORA}" | "${PIDD_OS_ROCKY}") "${PIDD_OS_ALMA}" | "${PIDD_OS_ARCH}" | "${PIDD_OS_FEDORA}" | "${PIDD_OS_ROCKY}")
PIDD_OS_VERSION=$(pidd_grep_os VERSION_ID \ PIDD_OS_VERSION=$(pidd_grep_os VERSION_ID \
| sed "s|^\([0-9]\+\)\..*|\1|") | sed "s|^\([0-9]\+\)\..*|\1|") ;;
;; "${PIDD_OS_ALPINE}")
"${PIDD_OS_ALPINE}") PIDD_OS_VERSION=$(pidd_grep_os VERSION_ID \
PIDD_OS_VERSION=$(pidd_grep_os VERSION_ID \ | sed "s|^\([0-9]\+\.[0-9]\+\)\..*|\1|") ;;
| sed "s|^\([0-9]\+\.[0-9]\+\)\..*|\1|") "${PIDD_OS_DEBIAN}" | "${PIDD_OS_UBUNTU}")
;; PIDD_OS_VERSION="$(pidd_grep_os VERSION_CODENAME)" ;;
"${PIDD_OS_DEBIAN}" | "${PIDD_OS_UBUNTU}") *) ;;
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
"${PIDD_OS_ALMA}" | "${PIDD_OS_ROCKY}") "${PIDD_OS_ALMA}" | "${PIDD_OS_ROCKY}")
case "${PIDD_OS_VERSION}" in case "${PIDD_OS_VERSION}" in
"8" | "9") ;; "8" | "9") ;;
*) pidd_error_os "PIDD_OS_VERSION" ;; *) pidd_error_os "PIDD_OS_VERSION" ;;
esac esac
;; ;;
"${PIDD_OS_ALPINE}") "${PIDD_OS_ALPINE}")
case "${PIDD_OS_VERSION}" in case "${PIDD_OS_VERSION}" in
"3.18" | "3.19") ;; "3.18" | "3.19") ;;
*) pidd_error_os "PIDD_OS_VERSION" ;; *) pidd_error_os "PIDD_OS_VERSION" ;;
esac esac
;; ;;
"${PIDD_OS_ARCH}") "${PIDD_OS_ARCH}")
case "${PIDD_OS_VERSION}" in case "${PIDD_OS_VERSION}" in
"20231112" | "20240101") ;; "20231112" | "20240101") ;;
*) pidd_error_os "PIDD_OS_VERSION" ;; *) pidd_error_os "PIDD_OS_VERSION" ;;
esac esac
;; ;;
"${PIDD_OS_DEBIAN}") "${PIDD_OS_DEBIAN}")
case "${PIDD_OS_VERSION}" in case "${PIDD_OS_VERSION}" in
"bookworm" | "bullseye") ;; "bookworm" | "bullseye") ;;
*) pidd_error_os "PIDD_OS_VERSION" ;; *) pidd_error_os "PIDD_OS_VERSION" ;;
esac esac
;; ;;
"${PIDD_OS_FEDORA}") "${PIDD_OS_FEDORA}")
case "${PIDD_OS_VERSION}" in case "${PIDD_OS_VERSION}" in
"39" | "40") ;; "39" | "40") ;;
*) pidd_error_os "PIDD_OS_VERSION" ;; *) pidd_error_os "PIDD_OS_VERSION" ;;
esac esac
;; ;;
"${PIDD_OS_UBUNTU}") "${PIDD_OS_UBUNTU}")
case "${PIDD_OS_VERSION}" in case "${PIDD_OS_VERSION}" in
"jammy" | "noble") ;; "jammy" | "noble") ;;
*) pidd_error_os "PIDD_OS_VERSION" ;; *) pidd_error_os "PIDD_OS_VERSION" ;;
esac esac
;; ;;
*) ;; *) ;;
esac esac