Skip to content

Commit

Permalink
added root check
Browse files Browse the repository at this point in the history
so we don't need to call sudo from inside of the script
  • Loading branch information
Michael Dec committed Jul 16, 2014
1 parent 856f261 commit d138967
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions scripts/deps.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d138967

Please sign in to comment.