mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-10 15:26:13 +01:00
enable remote mysql in cyberpanel.sh
This commit is contained in:
@@ -8,6 +8,15 @@ DEV="OFF"
|
|||||||
POSTFIX_VARIABLE="ON"
|
POSTFIX_VARIABLE="ON"
|
||||||
POWERDNS_VARIABLE="ON"
|
POWERDNS_VARIABLE="ON"
|
||||||
PUREFTPD_VARIABLE="ON"
|
PUREFTPD_VARIABLE="ON"
|
||||||
|
|
||||||
|
### Remote MySQL Variables
|
||||||
|
|
||||||
|
REMOTE_MYSQL='OFF'
|
||||||
|
MYSQL_HOST=''
|
||||||
|
MYSQL_USER=''
|
||||||
|
MYSQL_PASSWORD=''
|
||||||
|
MYSQL_PORT=''
|
||||||
|
|
||||||
PROVIDER="undefined"
|
PROVIDER="undefined"
|
||||||
SERIAL_NO=""
|
SERIAL_NO=""
|
||||||
DIR=$(pwd)
|
DIR=$(pwd)
|
||||||
@@ -856,6 +865,42 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
### Ask if you want to set up this CyberPanel with remote MySQL
|
||||||
|
|
||||||
|
echo -e "\nDo you want to setup Remote MySQL? (This will skip installation of local MySQL)"
|
||||||
|
echo -e ""
|
||||||
|
printf "%s" "Remote MySQL [Y/n]: "
|
||||||
|
read TMP_YN
|
||||||
|
if [[ `expr "x$TMP_YN" : 'x[Yy]'` -gt 1 ]] || [[ $TMP_YN == "" ]] ; then
|
||||||
|
echo -e "\nRemote MySQL selected..."
|
||||||
|
REMOTE_MYSQL='ON'
|
||||||
|
|
||||||
|
echo -e ""
|
||||||
|
printf "%s" "Remote MySQL Hostname: "
|
||||||
|
read MYSQL_HOST
|
||||||
|
|
||||||
|
echo -e ""
|
||||||
|
printf "%s" "Remote MySQL Username: "
|
||||||
|
read MYSQL_USER
|
||||||
|
|
||||||
|
echo -e ""
|
||||||
|
printf "%s" "Remote MySQL Password: "
|
||||||
|
read MYSQL_PASSWORD
|
||||||
|
|
||||||
|
echo -e ""
|
||||||
|
printf "%s" "Remote MySQL Port: "
|
||||||
|
read MYSQL_PORT
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
echo -e ""
|
||||||
|
printf "%s" "Local MySQL selected.."
|
||||||
|
echo -e ""
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
#above comment for future use
|
#above comment for future use
|
||||||
|
|
||||||
#if [[ $DEV_ARG == "ON" ]] ; then
|
#if [[ $DEV_ARG == "ON" ]] ; then
|
||||||
@@ -1029,9 +1074,17 @@ if [[ $debug == "1" ]] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $REDIS_HOSTING == "Yes" ]] ; then
|
if [[ $REDIS_HOSTING == "Yes" ]] ; then
|
||||||
/usr/local/CyberPanel/bin/python install.py $SERVER_IP $SERIAL_NO $LICENSE_KEY --postfix $POSTFIX_VARIABLE --powerdns $POWERDNS_VARIABLE --ftp $PUREFTPD_VARIABLE --redis enable
|
if [[ $REMOTE_MYSQL == "Yes" ]] ; then
|
||||||
|
/usr/local/CyberPanel/bin/python install.py $SERVER_IP $SERIAL_NO $LICENSE_KEY --postfix $POSTFIX_VARIABLE --powerdns $POWERDNS_VARIABLE --ftp $PUREFTPD_VARIABLE --redis enable --remotemysql $REMOTE_MYSQL --mysqlhost $MYSQL_HOST --mysqluser $MYSQL_USER --mysqlpassword $MYSQL_PASSWORD --mysqlport $MYSQL_PORT
|
||||||
|
else
|
||||||
|
/usr/local/CyberPanel/bin/python install.py $SERVER_IP $SERIAL_NO $LICENSE_KEY --postfix $POSTFIX_VARIABLE --powerdns $POWERDNS_VARIABLE --ftp $PUREFTPD_VARIABLE --redis enable
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
/usr/local/CyberPanel/bin/python install.py $SERVER_IP $SERIAL_NO $LICENSE_KEY --postfix $POSTFIX_VARIABLE --powerdns $POWERDNS_VARIABLE --ftp $PUREFTPD_VARIABLE
|
if [[ $REMOTE_MYSQL == "Yes" ]] ; then
|
||||||
|
/usr/local/CyberPanel/bin/python install.py $SERVER_IP $SERIAL_NO $LICENSE_KEY --postfix $POSTFIX_VARIABLE --powerdns $POWERDNS_VARIABLE --ftp $PUREFTPD_VARIABLE --remotemysql $REMOTE_MYSQL --mysqlhost $MYSQL_HOST --mysqluser $MYSQL_USER --mysqlpassword $MYSQL_PASSWORD --mysqlport $MYSQL_PORT
|
||||||
|
else
|
||||||
|
/usr/local/CyberPanel/bin/python install.py $SERVER_IP $SERIAL_NO $LICENSE_KEY --postfix $POSTFIX_VARIABLE --powerdns $POWERDNS_VARIABLE --ftp $PUREFTPD_VARIABLE
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if grep "CyberPanel installation successfully completed" /var/log/installLogs.txt > /dev/null; then
|
if grep "CyberPanel installation successfully completed" /var/log/installLogs.txt > /dev/null; then
|
||||||
|
|||||||
@@ -284,7 +284,6 @@ class InstallCyberPanel:
|
|||||||
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
############## Start mariadb ######################
|
############## Start mariadb ######################
|
||||||
|
|
||||||
self.startMariaDB()
|
self.startMariaDB()
|
||||||
@@ -648,6 +647,7 @@ def Main(cwd, mysql, distro, ent, serial = None, port = "8090", ftp = None, dns
|
|||||||
installer.installMySQL(mysql)
|
installer.installMySQL(mysql)
|
||||||
installer.changeMYSQLRootPassword()
|
installer.changeMYSQLRootPassword()
|
||||||
#installer.changeMYSQLRootPasswordCyberPanel(mysql)
|
#installer.changeMYSQLRootPasswordCyberPanel(mysql)
|
||||||
|
|
||||||
installer.startMariaDB()
|
installer.startMariaDB()
|
||||||
if distro == ubuntu:
|
if distro == ubuntu:
|
||||||
installer.fixMariaDB()
|
installer.fixMariaDB()
|
||||||
|
|||||||
Reference in New Issue
Block a user