better chattr detection for disk enforcement limit

better chattr detection supported by both ubuntu, rocky linux, alma linux and centos
This commit is contained in:
Greenweb Bangladesh 2025-10-07 14:52:44 +06:00 committed by GitHub
parent 6b9a9dc457
commit 9e7b9466c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -386,9 +386,9 @@ class FileManager:
command = 'touch %s/public_html/hello.txt' % (self.homePath)
result = ProcessUtilities.outputExecutioner(command)
result_lower = result.lower()
if result.find('cannot touch') > -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)
@ -454,8 +454,9 @@ class FileManager:
command = 'touch %s/public_html/hello.txt' % (self.homePath)
result = ProcessUtilities.outputExecutioner(command)
result_lower = result.lower()
if result.find('cannot touch') > -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)