diff --git a/glances-install.sh b/glances-install.sh index 4dba3e8..6080b9a 100644 --- a/glances-install.sh +++ b/glances-install.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash Color_Off='\033[0m' Blue='\033[0;34m' @@ -11,7 +11,6 @@ Red='\033[10;31m' LRed='\033[1;31m' #echo -e "${Green}TEST${Color_Off}" - # Execute a command as root (or sudo) do_with_root() { # already root? "Just do it" (tm). @@ -46,7 +45,7 @@ else done fi -echo "Detected system:" $distrib_name +echo -e "${LGreen}Detected system: $distrib_name${Color_Off}" shopt -s nocasematch # Let's do the installation @@ -97,15 +96,37 @@ else fi shopt -u nocasematch -echo "Install dependancies" +echo -e "${Green}Install dependancies${Color_Off}" -# Glances issue #922: Do not install PySensors (SENSORS) -#DEPS="setuptools glances[action,batinfo,browser,cpuinfo,chart,docker,export,folders,gpu,ip,raid,snmp,web,wifi]" -DEPS="setuptools glances[action,browser,cpuinfo,chart,docker,export,folders,ip,snmp,web]" -# Install libs -do_with_root pip install --upgrade pip -do_with_root pip install $DEPS +DEPS=$(whiptail --title "Select which modules to install for Glances" --checklist --separate-output \ +"Choose user's permissions" 28 80 14 \ +"action" "ation" ON \ +"batinfo" "batinfo" OFF \ +"browser" "browser" ON \ +"cpuinfo" "cpuinfo" ON \ +"chart" "chart" ON \ +"docker" "docker" OFF \ +"export" "export" ON \ +"folders" "folders" ON \ +"gpu" "gpu" OFF \ +"ip" "ip" ON \ +"raid" "raid" OFF \ +"snmp" "snmp" ON \ +"web" "web" ON \ +"wi +fi" "wifi" OFF 3>&1 1>&2 2>&3) + +exitstatus=$? + +if [ $exitstatus = 0 ]; then + do_with_root pip install --upgrade pip + + for DEP in $DEPS + do + do_with_root pip install $DEP + done +fi # Install or ugrade Glances from the Pipy repository if [[ -x /usr/local/bin/glances || -x /usr/bin/glances ]]; then