Merge 9e7b9466c9 into 2e8d9d5e8e
This commit is contained in:
commit
5d8ace2ec2
|
|
@ -386,17 +386,18 @@ class FileManager:
|
|||
|
||||
RemoveOK = 1
|
||||
|
||||
command = 'touch %s/hello.txt' % (self.homePath)
|
||||
command = 'touch %s/public_html/hello.txt' % (self.homePath)
|
||||
result = ProcessUtilities.outputExecutioner(command)
|
||||
result_lower = result.lower()
|
||||
|
||||
if result.find('No such file or directory') > -1:
|
||||
if 'cannot touch' in result_lower or 'no such file or directory' in result_lower:
|
||||
RemoveOK = 0
|
||||
|
||||
command = 'chattr -R -i %s' % (self.homePath)
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
else:
|
||||
command = 'rm -f %s/hello.txt' % (self.homePath)
|
||||
command = 'rm -f %s/public_html/hello.txt' % (self.homePath)
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
|
||||
|
|
@ -424,6 +425,24 @@ class FileManager:
|
|||
if RemoveOK == 0:
|
||||
command = 'chattr -R +i %s' % (self.homePath)
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'chattr -R -i %s' % (self.homePath) + '/logs/'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'chattr -R -i %s' % (self.homePath) + '/.trash/'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'chattr -R -i %s' % (self.homePath) + '/backup/'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'chattr -R -i %s' % (self.homePath) + '/incbackup/'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'chattr -R -i %s' % (self.homePath) + '/lscache/'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'chattr -R -i %s' % (self.homePath) + '/.cagefs/'
|
||||
ProcessUtilities.executioner(command)
|
||||
except:
|
||||
try:
|
||||
skipTrash = self.data['skipTrash']
|
||||
|
|
@ -435,17 +454,18 @@ class FileManager:
|
|||
|
||||
RemoveOK = 1
|
||||
|
||||
command = 'touch %s/hello.txt' % (self.homePath)
|
||||
command = 'touch %s/public_html/hello.txt' % (self.homePath)
|
||||
result = ProcessUtilities.outputExecutioner(command)
|
||||
result_lower = result.lower()
|
||||
|
||||
if result.find('No such file or directory') > -1:
|
||||
if 'cannot touch' in result_lower or 'no such file or directory' in result_lower:
|
||||
RemoveOK = 0
|
||||
|
||||
command = 'chattr -R -i %s' % (self.homePath)
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
else:
|
||||
command = 'rm -f %s/hello.txt' % (self.homePath)
|
||||
command = 'rm -f %s/public_html/hello.txt' % (self.homePath)
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
for item in self.data['fileAndFolders']:
|
||||
|
|
@ -462,6 +482,24 @@ class FileManager:
|
|||
if RemoveOK == 0:
|
||||
command = 'chattr -R +i %s' % (self.homePath)
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'chattr -R -i %s' % (self.homePath) + '/logs/'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'chattr -R -i %s' % (self.homePath) + '/.trash/'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'chattr -R -i %s' % (self.homePath) + '/backup/'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'chattr -R -i %s' % (self.homePath) + '/incbackup/'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'chattr -R -i %s' % (self.homePath) + '/lscache/'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'chattr -R -i %s' % (self.homePath) + '/.cagefs/'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
json_data = json.dumps(finalData)
|
||||
return HttpResponse(json_data)
|
||||
|
|
|
|||
Loading…
Reference in New Issue