Commit d011ab99 by John Jarvis

added root user check

parent 3b3cf5b7
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
set -e set -e
error() { error() {
printf '\E[36m'; echo "$@"; printf '\E[0m' printf '\E[31m'; echo "$@"; printf '\E[0m'
} }
output() { output() {
printf '\E[36m'; echo "$@"; printf '\E[0m' printf '\E[36m'; echo "$@"; printf '\E[0m'
...@@ -29,10 +29,10 @@ info() { ...@@ -29,10 +29,10 @@ info() {
Ruby ver : $RUBY_VER Ruby ver : $RUBY_VER
EO EO
}
}
PROG=${0##*/} PROG=${0##*/}
BASE="$HOME/mitx_all" BASE="$HOME/mitx_all"
PYTHON_DIR="$BASE/python" PYTHON_DIR="$BASE/python"
...@@ -44,6 +44,12 @@ LOG="/var/tmp/install.log" ...@@ -44,6 +44,12 @@ LOG="/var/tmp/install.log"
BREW_PKGS="readline sqlite gdbm pkg-config gfortran mercurial python yuicompressor node" BREW_PKGS="readline sqlite gdbm pkg-config gfortran mercurial python yuicompressor node"
APT_PKGS="curl git mercurial python-virtualenv build-essential python-dev gfortran liblapack-dev libfreetype6-dev libpng12-dev libxml2-dev libxslt-dev yui-compressor coffeescript" APT_PKGS="curl git mercurial python-virtualenv build-essential python-dev gfortran liblapack-dev libfreetype6-dev libpng12-dev libxml2-dev libxslt-dev yui-compressor coffeescript"
if [[ $EUID -eq 0 ]]; then
error "This script should not be run using sudo or as the root user"
usage
exit 1
fi
ARGS=$(getopt "cvh" "$*") ARGS=$(getopt "cvh" "$*")
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
usage usage
......
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