X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=installer%2Ffunctions.sh;h=36d10ec70ad892e066e2d1eba0f7702c1cee37f0;hb=b060bae83cc36fdc4f14120228e4c9b0d1ec42e8;hp=02b061d81999e470370ff250f46db194c4dbe7a5;hpb=c97eaeb9dfad7190e03c0ca264ea6ae76f404edd;p=netdata.git diff --git a/installer/functions.sh b/installer/functions.sh index 02b061d8..36d10ec7 100644 --- a/installer/functions.sh +++ b/installer/functions.sh @@ -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'