diff options
author | Iván Ávalos <avalos@disroot.org> | 2024-02-28 08:22:25 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2024-02-28 08:22:25 -0600 |
commit | 6ed69587af163a52ae3ad159654503d72a45055d (patch) | |
tree | 747f0bfe5a744798fdf491b67a038a9f495e2fe6 | |
parent | 7bfb0a93c4664d79be8a87c60c7c0f615e1fa045 (diff) | |
download | deployment-dev/ivan-avalos/exchangetos.tar.gz deployment-dev/ivan-avalos/exchangetos.tar.bz2 deployment-dev/ivan-avalos/exchangetos.zip |
Improve distro detection in regional currency scriptdev/ivan-avalos/exchangetos
-rwxr-xr-x | regional-currency/functions.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/regional-currency/functions.sh b/regional-currency/functions.sh index 749d1bd..0663fec 100755 --- a/regional-currency/functions.sh +++ b/regional-currency/functions.sh @@ -26,10 +26,11 @@ function check_user() { # status if distro not supported. function detect_distro() { unset DISTRO + [[ -f /etc/os-release ]] && source /etc/os-release # shellcheck disable=SC2034 - uname -a | grep Ubuntu >/dev/null && DISTRO=ubuntu && return 0 + echo $NAME | grep Ubuntu >/dev/null && DISTRO=ubuntu && return 0 # shellcheck disable=SC2034 - uname -a | grep Debian >/dev/null && DISTRO=debian && return 0 + echo $NAME | grep Debian >/dev/null && DISTRO=debian && return 0 echo "Unsupported distro, should be either ubuntu or debian" >&2 return 1 -}
\ No newline at end of file +} |