From b66bc75d5f159c379f9e98b68626a4594232bb94 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 20 Feb 2013 12:39:35 +0000 Subject: [PATCH] Use the `lsb_release` binary if available. Refs #55. --- bootstrap-salt.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 8cb7988..6381579 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -375,7 +375,13 @@ __gather_linux_system_info() { DISTRO_NAME="" DISTRO_VERSION="" - if [ -f /etc/lsb-release ]; then + # Let's test if the lsb_release binary is available + rv=$(lsb_release 2>&1) + if [ "x${rv}" != "x" ]; then + DISTRO_NAME=$(lsb_release -si) + rv=$(lsb_release -sr) + [ "${rv}x" != "x" ] && DISTRO_VERSION=$(__parse_version_string "$rv") + elif [ -f /etc/lsb-release ]; then DISTRO_NAME=$(grep DISTRIB_ID /etc/lsb-release | sed -e 's/.*=//') rv=$(grep DISTRIB_RELEASE /etc/lsb-release | sed -e 's/.*=//') [ "${rv}x" != "x" ] && DISTRO_VERSION=$(__parse_version_string "$rv")