summaryrefslogtreecommitdiffstats
path: root/daemon/system-info.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-09-03 10:23:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-09-03 10:23:38 +0000
commit574098461cd45be12a497afbdac6f93c58978387 (patch)
tree9eb60a5930b7c20d42f7fde1e234cae3968ed3d9 /daemon/system-info.sh
parentAdding upstream version 1.16.1. (diff)
downloadnetdata-574098461cd45be12a497afbdac6f93c58978387.tar.xz
netdata-574098461cd45be12a497afbdac6f93c58978387.zip
Adding upstream version 1.17.0.upstream/1.17.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xdaemon/system-info.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/daemon/system-info.sh b/daemon/system-info.sh
index 1f5bc52b1..6fab741fd 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