From 3db90e3f7f54b1d6ac9cc8962af1726b07f30362 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Mon, 17 Oct 2022 12:25:25 -0700 Subject: [PATCH] fix check for root user, set noninteractive --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 9d7f42a..6877f7c 100644 --- a/install.sh +++ b/install.sh @@ -6,7 +6,7 @@ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # # must be root -if [ "$USER" != "root" ]; then +if [ "${EUID}" -ne 0 ]; then echo "You must be root to run this installer." exit fi @@ -47,10 +47,10 @@ dbuser=`grep -m 1 user /var/vmail/.my.cnf |cut -d = -f 2|cut -d ' ' -f 2` dbpass=`grep -m 1 password /var/vmail/.my.cnf |cut -d = -f 2|cut -d ' ' -f 2` sed -i "s|.*db_dsnw.*|\$config['db_dsnw'] = 'mysql://$dbuser:$dbpass@$dbhost/$dbdatabase';|g" /srv/www/html/roundcube/config/config.inc.php -apt-get update +DEBIAN_FRONTEND=noninteractive apt-get -y update # make sure pwgen is installed -apt-get -qq -y install pwgen +DEBIAN_FRONTEND=noninteractive apt-get -qq -y install pwgen # create random key des_key=`pwgen -1 24`