Skip to content

Commit

Permalink
Update deps.sh
Browse files Browse the repository at this point in the history
"/etc/os-release" is more common than "/etc/lsb-release"
source: https://gist.github.com/natefoo/814c5bf936922dad97ff
  • Loading branch information
przemech committed Oct 20, 2019
1 parent be738a5 commit 39fb5d5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions deps.sh
Expand Up @@ -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
Expand Down

0 comments on commit 39fb5d5

Please sign in to comment.