Commit 437749ac authored by Paul Sherwood's avatar Paul Sherwood

Merge branch 'jjardon/sudo_fix' into 'master'

install_dependencies.sh: Make sudo optional



See merge request !249
parents 65bd91f4 7631d2c6
Pipeline #4591403 passed with stages
in 6 minutes and 47 seconds
......@@ -22,12 +22,17 @@
# echo what we're doing
set -x
SUDO=""
if [ "$EUID" -ne 0 ]
then SUDO="sudo"
fi
installed=false
# install dependencies for debian, ubuntu
which apt-get 2>&1 > /dev/null
if [ $? -eq 0 ]; then
sudo apt-get -qq update
sudo apt-get -qq install build-essential gawk git m4 wget
$SUDO apt-get -qq update
$SUDO apt-get -qq install build-essential gawk git m4 wget
if [ $? -ne 0 ]; then
echo "Install failed"
exit 1
......@@ -38,7 +43,7 @@ fi
# install for fedora
which dnf 2>&1 > /dev/null
if [ $? -eq 0 ] && [ $installed = false ]; then
sudo dnf install -y which make automake gcc gcc-c++ gawk git m4 wget python
$SUDO dnf install -y which make automake gcc gcc-c++ gawk git m4 wget python
if [ $? -ne 0 ]; then
echo "Install failed"
exit 1
......@@ -49,7 +54,7 @@ fi
# install for aws
which yum 2>&1 > /dev/null
if [ $? -eq 0 ] && [ $installed = false ]; then
sudo yum install -y which make automake gcc gcc-c++ gawk git m4 wget python
$SUDO yum install -y which make automake gcc gcc-c++ gawk git m4 wget python
if [ $? -ne 0 ]; then
echo "Install failed"
exit 1
......@@ -60,7 +65,7 @@ fi
# install for Arch
which pacman 2>&1 > /dev/null
if [ $? -eq 0 ] && [ $installed = false ]; then
sudo pacman -S --noconfirm which make automake gcc gawk git m4 wget python2
$SUDO pacman -S --noconfirm which make automake gcc gawk git m4 wget python2
if [ $? -ne 0 ]; then
echo "Install failed"
exit 1
......@@ -76,10 +81,10 @@ fi
pip --version 2>&1 > /dev/null
if [ $? -ne 0 ]; then
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo rm get-pip.py
$SUDO get-pip.py
$SUDO rm get-pip.py
fi
sudo pip install fs pyyaml sandboxlib requests
sudo pip install jsonschema bottle cherrypy riemann-client
sudo pip install pep8
$SUDO pip install fs pyyaml sandboxlib requests
$SUDO pip install jsonschema bottle cherrypy riemann-client
$SUDO pip install pep8
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment