mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 06:16:08 +01:00
dynamic debug logging
This commit is contained in:
@@ -9,6 +9,7 @@ import getpass
|
|||||||
import codecs
|
import codecs
|
||||||
|
|
||||||
class ProcessUtilities(multi.Thread):
|
class ProcessUtilities(multi.Thread):
|
||||||
|
debugPath = '/home/cyberpanel/debug'
|
||||||
litespeedProcess = "litespeed"
|
litespeedProcess = "litespeed"
|
||||||
ent = 1
|
ent = 1
|
||||||
OLS = 0
|
OLS = 0
|
||||||
@@ -187,12 +188,14 @@ class ProcessUtilities(multi.Thread):
|
|||||||
sock = ret[0]
|
sock = ret[0]
|
||||||
|
|
||||||
if user == None:
|
if user == None:
|
||||||
#logging.writeToFile(ProcessUtilities.token + command)
|
if os.path.exists(ProcessUtilities.debugPath):
|
||||||
|
logging.writeToFile(ProcessUtilities.token + command)
|
||||||
sock.sendall((ProcessUtilities.token + command).encode('utf-8'))
|
sock.sendall((ProcessUtilities.token + command).encode('utf-8'))
|
||||||
else:
|
else:
|
||||||
command = '%s-u %s %s' % (ProcessUtilities.token, user, command)
|
command = '%s-u %s %s' % (ProcessUtilities.token, user, command)
|
||||||
command = command.replace('sudo', '')
|
command = command.replace('sudo', '')
|
||||||
#logging.writeToFile(command)
|
if os.path.exists(ProcessUtilities.debugPath):
|
||||||
|
logging.writeToFile(command)
|
||||||
sock.sendall(command.encode('utf-8'))
|
sock.sendall(command.encode('utf-8'))
|
||||||
|
|
||||||
data = ""
|
data = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user