Skip to content

Commit

Permalink
Move sudo user check below other checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Frye committed Jan 26, 2011
1 parent 9333ab2 commit 8d4c349
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions railsready.sh
Expand Up @@ -30,9 +30,6 @@ control_c()
# trap keyboard interrupt (control-c)
trap control_c SIGINT

# Check if the user has sudo privileges.
sudo -v >/dev/null 2>&1 || { echo $script_runner has no sudo privileges ; exit 1; }

echo -e "\n\n"
echo "#################################"
echo "########## Rails Ready ##########"
Expand All @@ -44,7 +41,7 @@ if [[ $distro_sig =~ ubuntu ]] ; then
elif [[ $distro_sig =~ centos ]] ; then
distro="centos"
else
echo -e "\nRails Ready currently only supports Ubuntu and CentOS (at this time)\n"
echo -e "\nRails Ready currently only supports Ubuntu and CentOS\n"
exit 1
fi

Expand All @@ -54,6 +51,9 @@ if [ $script_runner == "root" ] ; then
exit 1
fi

# Check if the user has sudo privileges.
sudo -v >/dev/null 2>&1 || { echo $script_runner has no sudo privileges ; exit 1; }

echo -e "\n\n"
echo "!!! This script will update your system! Run on a fresh install only !!!"
echo "run tail -f $log_file in a new terminal to watch the install"
Expand Down

0 comments on commit 8d4c349

Please sign in to comment.