mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-13 08:46:09 +01:00
add progress to install
This commit is contained in:
@@ -40,6 +40,7 @@ VIRT_TYPE=""
|
|||||||
MASTER_GIT_URL="github.com/usmannasir/cyberpanel"
|
MASTER_GIT_URL="github.com/usmannasir/cyberpanel"
|
||||||
|
|
||||||
set_git_repos_and_branch() {
|
set_git_repos_and_branch() {
|
||||||
|
echo 'Setting up Branches,1' >/var/log/installLogs.txt
|
||||||
local GIT_DIR
|
local GIT_DIR
|
||||||
local GIT_USER
|
local GIT_USER
|
||||||
local GIT_REPO
|
local GIT_REPO
|
||||||
@@ -66,6 +67,7 @@ set_git_repos_and_branch() {
|
|||||||
printf "Github Content URL: %s\n" "$GIT_CONTENT_URL"
|
printf "Github Content URL: %s\n" "$GIT_CONTENT_URL"
|
||||||
printf "Github Branch: %s\n" "$BRANCH_NAME"
|
printf "Github Branch: %s\n" "$BRANCH_NAME"
|
||||||
printf "~~~~~~~~~~\n"
|
printf "~~~~~~~~~~\n"
|
||||||
|
echo 'Setting up Branches,1' >/var/log/installLogs.txt
|
||||||
}
|
}
|
||||||
|
|
||||||
disable_repos() {
|
disable_repos() {
|
||||||
@@ -404,7 +406,7 @@ root hard nproc 65535" >>/etc/security/limits.conf
|
|||||||
}
|
}
|
||||||
|
|
||||||
install_required() {
|
install_required() {
|
||||||
|
echo 'Installing necessary components..,3' >/var/log/installLogs.txt
|
||||||
if [[ -d /etc/yum.repos.d ]]; then
|
if [[ -d /etc/yum.repos.d ]]; then
|
||||||
|
|
||||||
yum clean all
|
yum clean all
|
||||||
@@ -504,6 +506,7 @@ EOF
|
|||||||
check_return
|
check_return
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
echo 'Necessary components installed,5' >/var/log/installLogs.txt
|
||||||
}
|
}
|
||||||
|
|
||||||
memcached_installation() {
|
memcached_installation() {
|
||||||
@@ -1250,6 +1253,7 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
after_install() {
|
after_install() {
|
||||||
|
echo 'Finalization..,80' >>/var/log/installLogs.txt
|
||||||
if [ ! -d "/var/lib/php" ]; then
|
if [ ! -d "/var/lib/php" ]; then
|
||||||
mkdir /var/lib/php
|
mkdir /var/lib/php
|
||||||
fi
|
fi
|
||||||
@@ -1524,6 +1528,7 @@ options edns0" /etc/resolv.conf
|
|||||||
echo "something went wrong..."
|
echo "something went wrong..."
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
argument_mode() {
|
argument_mode() {
|
||||||
@@ -1669,6 +1674,8 @@ initialize() {
|
|||||||
else
|
else
|
||||||
DOWNLOAD_SERVER="cdn.cyberpanel.sh"
|
DOWNLOAD_SERVER="cdn.cyberpanel.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo 'Initialization completed..,2' >/var/log/installLogs.txt
|
||||||
}
|
}
|
||||||
|
|
||||||
begin_install() {
|
begin_install() {
|
||||||
@@ -1695,3 +1702,5 @@ begin_install() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
begin_install "$@"
|
begin_install "$@"
|
||||||
|
|
||||||
|
echo 'Completed [200]' >>/var/log/installLogs.txt
|
||||||
@@ -2157,7 +2157,7 @@ def main():
|
|||||||
parser.add_argument('--mysqlport', help='MySQL port if remote is chosen.')
|
parser.add_argument('--mysqlport', help='MySQL port if remote is chosen.')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
logging.InstallLog.writeToFile("Starting CyberPanel installation..")
|
logging.InstallLog.writeToFile("Starting CyberPanel installation..,10")
|
||||||
preFlightsChecks.stdOut("Starting CyberPanel installation..")
|
preFlightsChecks.stdOut("Starting CyberPanel installation..")
|
||||||
|
|
||||||
if args.ent == None:
|
if args.ent == None:
|
||||||
@@ -2348,7 +2348,7 @@ echo $oConfig->Save() ? 'Done' : 'Error';
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
logging.InstallLog.writeToFile("CyberPanel installation successfully completed!")
|
logging.InstallLog.writeToFile("CyberPanel installation successfully completed!,80")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -656,13 +656,16 @@ def Main(cwd, mysql, distro, ent, serial = None, port = "8090", ftp = None, dns
|
|||||||
|
|
||||||
installer = InstallCyberPanel("/usr/local/lsws/",cwd, distro, ent, serial, port, ftp, dns, publicip, remotemysql, mysqlhost, mysqldb, mysqluser, mysqlpassword, mysqlport)
|
installer = InstallCyberPanel("/usr/local/lsws/",cwd, distro, ent, serial, port, ftp, dns, publicip, remotemysql, mysqlhost, mysqldb, mysqluser, mysqlpassword, mysqlport)
|
||||||
|
|
||||||
|
logging.InstallLog.writeToFile('Installing LiteSpeed Web server,40')
|
||||||
installer.installLiteSpeed()
|
installer.installLiteSpeed()
|
||||||
if ent == 0:
|
if ent == 0:
|
||||||
installer.changePortTo80()
|
installer.changePortTo80()
|
||||||
|
logging.InstallLog.writeToFile('Installing Optimized PHPs..,50')
|
||||||
installer.installAllPHPVersions()
|
installer.installAllPHPVersions()
|
||||||
if ent == 0:
|
if ent == 0:
|
||||||
installer.fix_ols_configs()
|
installer.fix_ols_configs()
|
||||||
|
|
||||||
|
logging.InstallLog.writeToFile('Installing MySQL,60')
|
||||||
installer.installMySQL(mysql)
|
installer.installMySQL(mysql)
|
||||||
installer.changeMYSQLRootPassword()
|
installer.changeMYSQLRootPassword()
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,19 @@ import time
|
|||||||
class InstallLog:
|
class InstallLog:
|
||||||
fileName = "/var/log/installLogs.txt"
|
fileName = "/var/log/installLogs.txt"
|
||||||
|
|
||||||
|
currentPercent = '10'
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def writeToFile(message):
|
def writeToFile(message):
|
||||||
|
|
||||||
|
if message.find(',') == -1:
|
||||||
|
message = '%s,%s' % (message, InstallLog.currentPercent)
|
||||||
|
elif message.find('mount -o') > -1 or message.find('usermod -G lscpd,') > -1:
|
||||||
|
message = '%s,%s' % (message.replace(',', '-'), InstallLog.currentPercent)
|
||||||
|
else:
|
||||||
|
InstallLog.currentPercent = message.split(',')[1]
|
||||||
|
|
||||||
file = open(InstallLog.fileName,'a')
|
file = open(InstallLog.fileName,'a')
|
||||||
file.writelines("[" + time.strftime(
|
file.writelines("[" + time.strftime(
|
||||||
"%m.%d.%Y_%H-%M-%S") + "] "+message + "\n")
|
"%m.%d.%Y_%H-%M-%S") + "] " + message + "\n")
|
||||||
file.close()
|
file.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user