From a0be5c3c4aa7e68b01b219fd0cb2af715c164a9d Mon Sep 17 00:00:00 2001 From: usmannasir Date: Fri, 22 Dec 2023 12:43:30 +0500 Subject: [PATCH] add command checking; --- plogical/DockerSites.py | 8 ++++---- plogical/processUtilities.py | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plogical/DockerSites.py b/plogical/DockerSites.py index 62c36ddc5..39e5510c0 100644 --- a/plogical/DockerSites.py +++ b/plogical/DockerSites.py @@ -291,7 +291,7 @@ def DeployWPContainer(self): ### WriteConfig to compose-file command = f"mkdir -p /home/docker/{self.data['finalURL']}" - result, message = ProcessUtilities.outputExecutioner(command) + result, message = ProcessUtilities.outputExecutioner(command, None, None, None, 1) if result == 0: logging.statusWriter(self.JobID, f'Error {str(message)} . [404]') @@ -304,7 +304,7 @@ def DeployWPContainer(self): WriteToFile.close() command = f"mv {TempCompose} {self.data['ComposePath']}" - result, message = ProcessUtilities.outputExecutioner(command) + result, message = ProcessUtilities.outputExecutioner(command, None, None, None, 1) if result == 0: logging.statusWriter(self.JobID, f'Error {str(message)} . [404]') @@ -316,7 +316,7 @@ def DeployWPContainer(self): #### command = f"docker-compose -f {self.data['ComposePath']} -p '{self.data['SiteName']}' up -d" - result, message = ProcessUtilities.outputExecutioner(command) + result, message = ProcessUtilities.outputExecutioner(command, None, None, None, 1) if result == 0: logging.statusWriter(self.JobID, f'Error {str(message)} . [404]') @@ -345,7 +345,7 @@ def DeployWPContainer(self): ### just restart ls for htaccess from plogical.installUtilities import installUtilities - installUtilities.reStartLiteSpeed() + installUtilities.reStartLiteSpeedSocket() logging.statusWriter(self.JobID, 'Completed. [200]') diff --git a/plogical/processUtilities.py b/plogical/processUtilities.py index 17ed5d5a7..3d6164f5b 100755 --- a/plogical/processUtilities.py +++ b/plogical/processUtilities.py @@ -299,6 +299,7 @@ def outputExecutioner(command, user=None, shell = None, dir = None, retRequired try: if os.path.exists('/usr/local/CyberCP/debug'): logging.writeToFile(command) + if getpass.getuser() == 'root': if os.path.exists(ProcessUtilities.debugPath): logging.writeToFile(command)