From d1389671177c78a8a8e8a31f53400f25e5d5e83b Mon Sep 17 00:00:00 2001 From: Michael Dec Date: Wed, 16 Jul 2014 04:20:57 +0100 Subject: [PATCH] added root check so we don't need to call sudo from inside of the script --- scripts/deps.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/scripts/deps.sh b/scripts/deps.sh index 8e3ca64..5531b7f 100755 --- a/scripts/deps.sh +++ b/scripts/deps.sh @@ -1,15 +1,20 @@ #!/bin/bash SATISFIED=0 -if [ -f "/etc/debian_version" ]; then - sudo apt-get install -y cmake libgtkmm-3.0-dev libglibmm-2.4-dev libtorrent-rasterbar-dev libboost-all-dev libssl-dev - SATISFIED=1 -fi +USER=`whoami` +if [ "$USER" != "root" ]; then + echo "You have to sudo or be root to install dependencies." +else + if [ -f "/etc/debian_version" ]; then + apt-get install -y cmake libgtkmm-3.0-dev libglibmm-2.4-dev libtorrent-rasterbar-dev libboost-all-dev libssl-dev + SATISFIED=1 + fi -if [ -f "/etc/gentoo-release" ]; then - emerge -vq dev-util/cmake dev-cpp/gtkmm dev-cpp/glibmm net-libs/rb_libtorrent dev-libs/boost dev-libs/openssl - SATISFIED=1 -fi + if [ -f "/etc/gentoo-release" ]; then + emerge -vq dev-util/cmake dev-cpp/gtkmm dev-cpp/glibmm net-libs/rb_libtorrent dev-libs/boost dev-libs/openssl + SATISFIED=1 + fi -if [ "$SATISFIED" -ne "1" ]; then - echo "Your system isn't supported yet." + if [ "$SATISFIED" -ne "1" ]; then + echo "Your system isn't supported yet." + fi fi