Skip to content

Commit

Permalink
bug fix: permissions during cpanel import'
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Apr 7, 2020
1 parent 806992b commit 28c3dfc
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions plogical/cPanelImporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down

0 comments on commit 28c3dfc

Please sign in to comment.