]> arthur.barton.de Git - netdata.git/commitdiff
check /proc only when it is available
authorCosta Tsaousis <costa@tsaousis.gr>
Tue, 20 Dec 2016 20:06:04 +0000 (22:06 +0200)
committerCosta Tsaousis <costa@tsaousis.gr>
Tue, 20 Dec 2016 20:06:04 +0000 (22:06 +0200)
netdata-installer.sh

index 10c7c18bb8ff2dfb93558130c71a7b218b220ff6..431178d9df0a05760b985b0d460e9e0d2d425270 100755 (executable)
@@ -836,9 +836,13 @@ fi
 # stop a running netdata
 
 isnetdata() {
-    [ -z "$1" -o ! -f "/proc/$1/stat" ] && return 1
-    [ "$(cat "/proc/$1/stat" | cut -d '(' -f 2 | cut -d ')' -f 1)" = "netdata" ] && return 0
-    return 1
+    if [ -d /proc ]
+    then
+        [ -z "$1" -o ! -f "/proc/$1/stat" ] && return 1
+        [ "$(cat "/proc/$1/stat" | cut -d '(' -f 2 | cut -d ')' -f 1)" = "netdata" ] && return 0
+        return 1
+    fi
+    return 0
 }
 
 stop_netdata_on_pid() {