Skip to content
Permalink
Browse files
bug fix: permissions during cpanel import'
  • Loading branch information
usmannasir committed Apr 7, 2020
1 parent 806992b commit 28c3dfc7af9e8346569fc50dc98a30228888efbb
Showing 1 changed file with 3 additions and 17 deletions.
@@ -713,23 +713,9 @@ def RestoreDatabases(self):
return 0

def FixPermissions(self):
externalApp = self.externalApp
command = "sudo chown -R " + externalApp + ":" + externalApp + " /home/" + self.mainDomain
ProcessUtilities.normalExecutioner(command)

if ProcessUtilities.decideDistro() == ProcessUtilities.centos:
groupName = 'nobody'
else:
groupName = 'nogroup'

command = "sudo chown -R root:%s /home/" % (groupName) + self.mainDomain + "/logs"
ProcessUtilities.normalExecutioner(command)

command = "sudo find %s -type d -exec chmod 0755 {} \;" % ("/home/" + self.mainDomain + "/public_html")
ProcessUtilities.normalExecutioner(command)

command = "sudo find %s -type f -exec chmod 0644 {} \;" % ("/home/" + self.mainDomain + "/public_html")
ProcessUtilities.normalExecutioner(command)
from filemanager.filemanager import FileManager
fm = FileManager(None, None)
fm.fixPermissions(self.mainDomain)

def MainController(self):

0 comments on commit 28c3dfc

Please sign in to comment.