diff --git a/setup-deps-ubuntu.bash b/setup-deps-ubuntu.bash index 1185389..16ef7c2 100644 --- a/setup-deps-ubuntu.bash +++ b/setup-deps-ubuntu.bash @@ -2,6 +2,10 @@ # curl -fsSL https://ldsconnect.org/setup-linux.bash | bash -c +# Not every platform has or needs sudo, gotta save them O(1)s... +sudo_cmd="" +((EUID)) && [[ -z "$ANDROID_ROOT" ]] && sudo_cmd="sudo" + NO_FAIL2BAN=${1} echo "" @@ -18,7 +22,7 @@ echo " * jshint" echo "" echo "updating apt-get..." -sudo bash -c "apt-get update -qq -y < /dev/null" > /dev/null +$sudo_cmd bash -c "apt-get update -qq -y < /dev/null" > /dev/null # fail2ban #if [ -z "$(which fail2ban-server | grep fail2ban)" ]; then @@ -32,5 +36,5 @@ sudo bash -c "apt-get update -qq -y < /dev/null" > /dev/null if [ -z "$(type -p pkg-config)" ] || [ -z "$(type -p git)" ] || [ -z "$(type -p wget)" ] || [ -z "$(type -p curl)" ] || [ -z "$(type -p gcc)" ] || [ -z "$(type -p rsync)" ] || [ -z "$(type -p python)" ] then echo "installing git, wget, curl, build-essential, rsync, pkg-config, python..." - sudo bash -c "apt-get install -qq -y git wget curl build-essential rsync pkg-config python < /dev/null" > /dev/null 2>/dev/null + $sudo_cmd bash -c "apt-get install -qq -y git wget curl build-essential rsync pkg-config python < /dev/null" > /dev/null 2>/dev/null fi