parent
caae003c60
commit
53570e236a
|
@ -90,6 +90,23 @@ lock_jobs
|
||||||
# hook
|
# hook
|
||||||
run-parts --arg=startup /usr/lib/alternc/install.d
|
run-parts --arg=startup /usr/lib/alternc/install.d
|
||||||
|
|
||||||
|
#######################################################################
|
||||||
|
# Enter the initial database configuration if needed
|
||||||
|
#
|
||||||
|
|
||||||
|
# Creating admin user if needed
|
||||||
|
# This is done before any templating, since it adds the default database server.
|
||||||
|
# User feedback is provided near the end of the script.
|
||||||
|
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 ""
|
||||||
|
|
||||||
|
su - alterncpanel -s /bin/bash -c /usr/share/alternc/install/newone.php
|
||||||
|
NEWONE_RETVAL=$?
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# Script configuration
|
# Script configuration
|
||||||
#
|
#
|
||||||
|
@ -606,15 +623,8 @@ chown alterncpanel:adm /var/log/alternc/bureau.log /var/log/alternc/update_domai
|
||||||
# Launch a script that will populate AlternC variables as needed
|
# Launch a script that will populate AlternC variables as needed
|
||||||
su - alterncpanel -s /bin/bash -c /usr/share/alternc/install/variables.php
|
su - alterncpanel -s /bin/bash -c /usr/share/alternc/install/variables.php
|
||||||
|
|
||||||
# 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
|
if [ "$HAS_ROOT" != "1" ]; then
|
||||||
echo "Creating admin user..."
|
if [ "$NEWONE_RETVAL" ] ; then
|
||||||
echo ""
|
|
||||||
|
|
||||||
if su - alterncpanel -s /bin/bash -c /usr/share/alternc/install/newone.php
|
|
||||||
then
|
|
||||||
echo "*******************************************"
|
echo "*******************************************"
|
||||||
echo "* *"
|
echo "* *"
|
||||||
echo "* Admin account *"
|
echo "* Admin account *"
|
||||||
|
@ -626,7 +636,7 @@ if [ "$HAS_ROOT" != "1" ]; then
|
||||||
echo "* *"
|
echo "* *"
|
||||||
echo "*******************************************"
|
echo "*******************************************"
|
||||||
else
|
else
|
||||||
echo "Unable to create the first AlternC account (named 'admin'). newone.php returned $?. Check your MySQL database, PHP, and the /etc/alternc/local.sh file. Also check for any error above during install."
|
echo "Unable to create the first AlternC account (named 'admin'). newone.php returned $NEWONE_RETVAL. Check your MySQL database, PHP, and the /etc/alternc/local.sh file. Also check for any error above during install."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
##UPDATE default db_server following /etc/alternc/my.cnf values
|
##UPDATE default db_server following /etc/alternc/my.cnf values
|
||||||
|
|
Loading…
Reference in New Issue