mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
install-reddit: Don't sudo inside install-reddit, require it outside
Previously, install-reddit.sh ran install/reddit.sh with sudo. This confused install.cfg when install-reddit.sh was itself run with sudo because the inner sudo would cause $SUDO_USER to erroneously be root. install-reddit.sh _should_ be run as sudo so that when it prints out install.cfg the values are accurate, but should not run install/reddit.sh with an additional sudo since that'll mess things up.
This commit is contained in:
@@ -22,6 +22,11 @@
|
||||
###############################################################################
|
||||
set -e
|
||||
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "ERROR: Must be run with root privileges."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# load configuration
|
||||
RUNDIR=$(dirname $0)
|
||||
SCRIPTDIR="$RUNDIR/install"
|
||||
@@ -95,6 +100,6 @@ important "but the easiest thing is probably editing /etc/hosts on the host mach
|
||||
echo
|
||||
read -er -n1 -p "proceed? [Y/n]" response
|
||||
if [[ $response =~ ^[Yy]$ || $response == "" ]]; then
|
||||
echo "Excellent. Here we go. We're going to need sudo for this one:"
|
||||
sudo $SCRIPTDIR/reddit.sh
|
||||
echo "Excellent. Here we go!"
|
||||
$SCRIPTDIR/reddit.sh
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user