]> arthur.barton.de Git - netdata.git/blobdiff - installer/functions.sh
Merge pull request #2021 from ktsaou/master
[netdata.git] / installer / functions.sh
index 02b061d81999e470370ff250f46db194c4dbe7a5..36d10ec70ad892e066e2d1eba0f7702c1cee37f0 100644 (file)
@@ -17,6 +17,32 @@ check_cmd() {
 # -----------------------------------------------------------------------------
 
 setup_terminal() {
+    TPUT_RESET=""
+    TPUT_BLACK=""
+    TPUT_RED=""
+    TPUT_GREEN=""
+    TPUT_YELLOW=""
+    TPUT_BLUE=""
+    TPUT_PURPLE=""
+    TPUT_CYAN=""
+    TPUT_WHITE=""
+    TPUT_BGBLACK=""
+    TPUT_BGRED=""
+    TPUT_BGGREEN=""
+    TPUT_BGYELLOW=""
+    TPUT_BGBLUE=""
+    TPUT_BGPURPLE=""
+    TPUT_BGCYAN=""
+    TPUT_BGWHITE=""
+    TPUT_BOLD=""
+    TPUT_DIM=""
+    TPUT_UNDERLINED=""
+    TPUT_BLINK=""
+    TPUT_INVERTED=""
+    TPUT_STANDOUT=""
+    TPUT_BELL=""
+    TPUT_CLEAR=""
+
     # Is stderr on the terminal? If not, then fail
     test -t 2 || return 1
 
@@ -265,8 +291,8 @@ iscontainer() {
 
     # /proc/1/sched exposes the host's pid of our init !
     # http://stackoverflow.com/a/37016302
-    local pid=$( cat /proc/1/sched | head -n 1 | { IFS='(),#:' read name pid th threads; echo $pid; } )
-    local p=$(( pid + 0 ))
+    local pid=$( cat /proc/1/sched 2>/dev/null | head -n 1 | { IFS='(),#:' read name pid th threads; echo $pid; } )
+    pid=$(( pid + 0 ))
     [ ${pid} -ne 1 ] && return 0
 
     # lxc sets environment variable 'container'