diff --git a/nextcloud-startup-script.sh b/nextcloud-startup-script.sh index 13868db0..e76f2306 100644 --- a/nextcloud-startup-script.sh +++ b/nextcloud-startup-script.sh @@ -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 diff --git a/nextcloud_install_production.sh b/nextcloud_install_production.sh index fb309b7d..e9aa7cac 100644 --- a/nextcloud_install_production.sh +++ b/nextcloud_install_production.sh @@ -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 diff --git a/static/change-ncadmin-profile.sh b/static/change-ncadmin-profile.sh index 163b13a5..216097bf 100644 --- a/static/change-ncadmin-profile.sh +++ b/static/change-ncadmin-profile.sh @@ -1,6 +1,6 @@ #!/bin/bash -UNIXUSER=$LOGNAME +UNIXUSER=$SUDO_USER UNIXUSER_PROFILE="~/.bash_profile" rm ~/.profile