Sudo user (#111)

* minor bug fixes

* revert to sudo user and not logname
This commit is contained in:
Daniel Hansson 2017-02-01 01:36:48 +01:00 committed by GitHub
parent 1c46747ede
commit 006fc3c8e4
3 changed files with 16 additions and 10 deletions

View File

@ -17,7 +17,7 @@ PHPMYADMIN_CONF="/etc/apache2/conf-available/phpmyadmin.conf"
GITHUB_REPO="https://raw.githubusercontent.com/nextcloud/vm/master"
STATIC="https://raw.githubusercontent.com/nextcloud/vm/master/static"
LETS_ENC="https://raw.githubusercontent.com/nextcloud/vm/master/lets-encrypt"
UNIXUSER=$LOGNAME
UNIXUSER=$SUDO_USER
NCPASS=nextcloud
NCUSER=ncadmin

View File

@ -39,7 +39,7 @@ IFACE=$(lshw -c network | grep "logical name" | awk '{print $3; exit}')
ADDRESS=$(hostname -I | cut -d ' ' -f 1)
# Linux user, and Nextcloud user
UNIXUSER=$LOGNAME
UNIXUSER=$SUDO_USER
NCPASS=nextcloud
NCUSER=ncadmin
@ -61,6 +61,19 @@ then
exit 1
fi
# Show current user
echo
echo "Current user with sudo permissions is: $UNIXUSER".
echo "This script will set everything up with that user."
echo "If the field after ":" is blank you are probably running as a pure root user."
echo "It's possible to install with root, but there will be minor errors."
echo "Please create a user with sudo permissions if you want an optimal installation."
echo "This script continues in 20 seconds, press CTRL+C to abort..."
sleep 20
echo
# Prefer IPv4
sed -i "s|#precedence ::ffff:0:0/96 100|precedence ::ffff:0:0/96 100|g" /etc/gai.conf
@ -128,13 +141,6 @@ then
exit 1
fi
# Show current user
echo
echo "Current user with sudo permissions is: $UNIXUSER".
echo "This script will set everything up with that user, FYI."
sleep 3
echo
# Create $SCRIPTS dir
if [ -d $SCRIPTS ]
then

View File

@ -1,6 +1,6 @@
#!/bin/bash
UNIXUSER=$LOGNAME
UNIXUSER=$SUDO_USER
UNIXUSER_PROFILE="~/.bash_profile"
rm ~/.profile