mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 13:25:51 +01:00
bug fix: docker install
This commit is contained in:
@@ -10,7 +10,7 @@ import time
|
||||
class DockerInstall:
|
||||
|
||||
@staticmethod
|
||||
def submitInstallDocker():
|
||||
def submitInstallDocker(CommandCP = 0):
|
||||
try:
|
||||
|
||||
statusFile = open(ServerStatusUtil.lswsInstallStatusPath, 'w')
|
||||
@@ -29,16 +29,20 @@ class DockerInstall:
|
||||
else:
|
||||
command = 'DEBIAN_FRONTEND=noninteractive apt-get install -y docker.io docker-compose'
|
||||
|
||||
if not ServerStatusUtil.executioner(command, statusFile):
|
||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
|
||||
"Failed to install Docker. [404]\n", 1)
|
||||
return 0
|
||||
if CommandCP:
|
||||
ProcessUtilities.executioner(command, 'root', True)
|
||||
else:
|
||||
if not ServerStatusUtil.executioner(command, statusFile):
|
||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
|
||||
"Failed to install Docker. [404]\n", 1)
|
||||
return 0
|
||||
|
||||
command = 'sudo systemctl enable docker'
|
||||
ServerStatusUtil.executioner(command, statusFile)
|
||||
|
||||
ProcessUtilities.executioner(command, 'root', True)
|
||||
|
||||
command = 'sudo systemctl start docker'
|
||||
ServerStatusUtil.executioner(command, statusFile)
|
||||
ProcessUtilities.executioner(command, 'root', True)
|
||||
|
||||
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
|
||||
"Docker successfully installed.[200]\n", 1)
|
||||
|
||||
Reference in New Issue
Block a user