diff options
author | Piotr Roszatycki <piotr.roszatycki@gmail.com> | 2019-08-09 08:21:32 +0200 |
---|---|---|
committer | Paul Emm. Katsoulakis <34388743+paulkatsoulakis@users.noreply.github.com> | 2019-08-09 09:21:32 +0300 |
commit | 4939021d5692df88e1e108b5c0d5f9b327a385e4 (patch) | |
tree | 8d70a7222767f1456be37d5b96cf935bec783b38 /daemon | |
parent | b26d023b211f164fa559ec23e48a2174daecfc4e (diff) |
Better system OS detection for RHEL6 and Mac OS X (#6612)
* On RHEL 6 file /etc/lsb-release is pretty useless
* Better OS version detection for Mac OS X
Diffstat (limited to 'daemon')
-rwxr-xr-x | daemon/system-info.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/daemon/system-info.sh b/daemon/system-info.sh index 1f5bc52b12..6fab741fde 100755 --- a/daemon/system-info.sh +++ b/daemon/system-info.sh @@ -22,8 +22,8 @@ if [ "${KERNEL_NAME}" = "Darwin" ]; then OIFS="$IFS" IFS=$'\n' set $(sw_vers) > /dev/null - NAME=$(echo $1 | tr "\n" ' ' | sed 's/ProductName:[ ]*//') - VERSION=$(echo $2 | tr "\n" ' ' | sed 's/ProductVersion:[ ]*//') + NAME=$(echo $1 | tr "\n\t" ' ' | sed -e 's/ProductName:[ ]*//' -e 's/[ ]*$//') + VERSION=$(echo $2 | tr "\n\t" ' ' | sed -e 's/ProductVersion:[ ]*//' -e 's/[ ]*$//') ID="mac" ID_LIKE="mac" OS_DETECTION="sw_vers" @@ -44,7 +44,8 @@ else if [ "${NAME}" = "unknown" ]; then NAME="${DISTRIB_ID}"; fi if [ "${VERSION}" = "unknown" ]; then VERSION="${DISTRIB_RELEASE}"; fi if [ "${ID}" = "unknown" ]; then ID="${DISTRIB_CODENAME}"; fi - elif [ -n "$(command -v lsb_release 2>/dev/null)" ]; then + fi + if [ -n "$(command -v lsb_release 2>/dev/null)" ]; then if [ "${OS_DETECTION}" = "unknown" ]; then OS_DETECTION="lsb_release"; else OS_DETECTION="Mixed"; fi if [ "${NAME}" = "unknown" ]; then NAME="$(lsb_release -is 2>/dev/null)"; fi if [ "${VERSION}" = "unknown" ]; then VERSION="$(lsb_release -rs 2>/dev/null)"; fi |