From 39fb5d518dd765a2f1450e64f5c41063b078c4ce Mon Sep 17 00:00:00 2001 From: Slepowid <33736833+Slepowid@users.noreply.github.com> Date: Sun, 20 Oct 2019 16:51:34 +0200 Subject: [PATCH] Update deps.sh "/etc/os-release" is more common than "/etc/lsb-release" source: https://gist.github.com/natefoo/814c5bf936922dad97ff --- deps.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/deps.sh b/deps.sh index eb3dc328..ae9795e1 100755 --- a/deps.sh +++ b/deps.sh @@ -13,9 +13,14 @@ set -o nounset if ! which lsb_release > /dev/null then function lsb_release { - if [ -f /etc/lsb-release ] + if [ -f /etc/os-release ] then - cat /etc/lsb-release | grep DISTRIB_ID | cut -d= -f 2 + [[ "$1" = "-i" ]] && cat /etc/os-release | grep ^"ID" | cut -d= -f 2 + [[ "$1" = "-r" ]] && cat /etc/os-release | grep "VERSION_ID" | cut -d= -d'"' -f 2 + elif [ -f /etc/lsb-release ] + then + [[ "$1" = "-i" ]] && cat /etc/lsb-release | grep "DISTRIB_ID" | cut -d= -f 2 + [[ "$1" = "-r" ]] && cat /etc/lsb-release | grep "DISTRIB_RELEASE" | cut -d= -f 2 else echo Unknown fi