diff --git a/install/alternc.install b/install/alternc.install index 911ad2c2..0f7be03a 100644 --- a/install/alternc.install +++ b/install/alternc.install @@ -417,9 +417,6 @@ fi chown alterncpanel:alterncpanel "$ALTERNC_LOC/html/"* setfacl -b -k -m d:g:alterncpanel:rw- -m g:alterncpanel:rw- "$ALTERNC_LOC/html/"* -# Creating admin user if needed -HAS_ROOT=`mysql --defaults-file=/etc/alternc/my.cnf -e "SELECT COUNT(*) FROM membres WHERE login = 'admin' OR login = 'root' and su = 1" | tail -1` - #creating log file if [ ! -e "/var/log/alternc/bureau.log" ]; then test -d "/var/log/alternc/" || mkdir -p "/var/log/alternc/" @@ -428,6 +425,9 @@ if [ ! -e "/var/log/alternc/bureau.log" ]; then chown alterncpanel:adm /var/log/alternc/bureau.log fi +# Creating admin user if needed +HAS_ROOT=`mysql --defaults-file=/etc/alternc/my.cnf -e "SELECT COUNT(*) FROM membres WHERE login = 'admin' OR login = 'root' and su = 1" | tail -1` + if [ "$HAS_ROOT" != "1" ]; then echo "Creating admin user..." echo ""