From 736a0174edcfae786d462af196a2687a78ff2a74 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 24 Jun 2024 11:44:21 +0200 Subject: [PATCH] cases --- pidd.sh | 81 +++++++++++++++++++++++++++------------------------------ 1 file changed, 39 insertions(+), 42 deletions(-) diff --git a/pidd.sh b/pidd.sh index a41c160..ebe94e9 100644 --- a/pidd.sh +++ b/pidd.sh @@ -72,56 +72,53 @@ pidd_set_environment_variables() { esac # set operating system version case "${PIDD_OS_ID}" in - "${PIDD_OS_ALMA}" | "${PIDD_OS_ARCH}" | "${PIDD_OS_FEDORA}" | "${PIDD_OS_ROCKY}") - PIDD_OS_VERSION=$(pidd_grep_os VERSION_ID \ - | sed "s|^\([0-9]\+\)\..*|\1|") - ;; - "${PIDD_OS_ALPINE}") - PIDD_OS_VERSION=$(pidd_grep_os VERSION_ID \ - | sed "s|^\([0-9]\+\.[0-9]\+\)\..*|\1|") - ;; - "${PIDD_OS_DEBIAN}" | "${PIDD_OS_UBUNTU}") - PIDD_OS_VERSION="$(pidd_grep_os VERSION_CODENAME)" - ;; - *) ;; + "${PIDD_OS_ALMA}" | "${PIDD_OS_ARCH}" | "${PIDD_OS_FEDORA}" | "${PIDD_OS_ROCKY}") + PIDD_OS_VERSION=$(pidd_grep_os VERSION_ID \ + | sed "s|^\([0-9]\+\)\..*|\1|") ;; + "${PIDD_OS_ALPINE}") + PIDD_OS_VERSION=$(pidd_grep_os VERSION_ID \ + | sed "s|^\([0-9]\+\.[0-9]\+\)\..*|\1|") ;; + "${PIDD_OS_DEBIAN}" | "${PIDD_OS_UBUNTU}") + PIDD_OS_VERSION="$(pidd_grep_os VERSION_CODENAME)" ;; + *) ;; esac # check operating system version case "${PIDD_OS_ID}" in - "${PIDD_OS_ALMA}" | "${PIDD_OS_ROCKY}") - case "${PIDD_OS_VERSION}" in - "8" | "9") ;; - *) pidd_error_os "PIDD_OS_VERSION" ;; - esac + "${PIDD_OS_ALMA}" | "${PIDD_OS_ROCKY}") + case "${PIDD_OS_VERSION}" in + "8" | "9") ;; + *) pidd_error_os "PIDD_OS_VERSION" ;; + esac ;; - "${PIDD_OS_ALPINE}") - case "${PIDD_OS_VERSION}" in - "3.18" | "3.19") ;; - *) pidd_error_os "PIDD_OS_VERSION" ;; - esac + "${PIDD_OS_ALPINE}") + case "${PIDD_OS_VERSION}" in + "3.18" | "3.19") ;; + *) pidd_error_os "PIDD_OS_VERSION" ;; + esac ;; - "${PIDD_OS_ARCH}") - case "${PIDD_OS_VERSION}" in - "20231112" | "20240101") ;; - *) pidd_error_os "PIDD_OS_VERSION" ;; - esac + "${PIDD_OS_ARCH}") + case "${PIDD_OS_VERSION}" in + "20231112" | "20240101") ;; + *) pidd_error_os "PIDD_OS_VERSION" ;; + esac ;; - "${PIDD_OS_DEBIAN}") - case "${PIDD_OS_VERSION}" in - "bookworm" | "bullseye") ;; - *) pidd_error_os "PIDD_OS_VERSION" ;; - esac + "${PIDD_OS_DEBIAN}") + case "${PIDD_OS_VERSION}" in + "bookworm" | "bullseye") ;; + *) pidd_error_os "PIDD_OS_VERSION" ;; + esac ;; - "${PIDD_OS_FEDORA}") - case "${PIDD_OS_VERSION}" in - "39" | "40") ;; - *) pidd_error_os "PIDD_OS_VERSION" ;; - esac + "${PIDD_OS_FEDORA}") + case "${PIDD_OS_VERSION}" in + "39" | "40") ;; + *) pidd_error_os "PIDD_OS_VERSION" ;; + esac ;; - "${PIDD_OS_UBUNTU}") - case "${PIDD_OS_VERSION}" in - "jammy" | "noble") ;; - *) pidd_error_os "PIDD_OS_VERSION" ;; - esac + "${PIDD_OS_UBUNTU}") + case "${PIDD_OS_VERSION}" in + "jammy" | "noble") ;; + *) pidd_error_os "PIDD_OS_VERSION" ;; + esac ;; *) ;; esac