From da5c722f7f9cafe49ba07f64471da5e6b18e2b9b Mon Sep 17 00:00:00 2001 From: tavo Date: Thu, 16 May 2024 15:57:36 -0600 Subject: [PATCH] better case statement --- 01-utils.sh | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/01-utils.sh b/01-utils.sh index 4b78c0b..3492858 100644 --- a/01-utils.sh +++ b/01-utils.sh @@ -48,17 +48,13 @@ set_version() { done case "$ID" in - debian) ID="$ID" ;; - ubuntu) ID="debian" ;; - fedora) ID="$ID" ;; - rhel) ID="fedora" ;; - centos) [ "$VERSION_ID" -eq 9 ] && ID="fedora" ;; - *suse*) ID="suse" ;; - sles) ID="suse" ;; - sled) ID="suse" ;; - arch) ID="$ID" ;; - manjaro) ID="arch" ;; - *) ID="${ID_LIKE%% *}" ;; + centos) [ -n "$VERSION_ID" ] && [ "$VERSION_ID" -eq 9 ] && + ID="fedora" ;; + *suse*|sles|sled) ID="suse" ;; + debian|ubuntu) ID="debian" ;; + fedora|rhel) ID="fedora" ;; + arch|manjaro) ID="arch" ;; + *) ID="${ID_LIKE%% *}" ;; esac [ "$ID" = "ubuntu" ] && ID="debian" @@ -99,4 +95,3 @@ if [ -z "$MENU" ] ; then command -v kdialog > /dev/null && MENU="kdialog" && return 0 fi } -