Skip to content

Commit dddc208

Browse files
authored
Add path option to createChild function
1 parent 749c4bc commit dddc208

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

cli/cyberPanel.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,13 @@ def createWebsite(self, package, owner, domainName, email, php, ssl, dkim, openB
7575
logger.writeforCLI(str(msg), "Error", stack()[0][3])
7676
self.printStatus(0, str(msg))
7777

78-
def createDomain(self, masterDomain, domainName, owner, php, ssl, dkim, openBasedir):
78+
def createDomain(self, masterDomain, domainName, owner, php, ssl, dkim, openBasedir, path):
7979
try:
8080

81-
path = '/home/' + masterDomain + '/public_html/' + domainName
81+
complete_path = '/home/' + masterDomain + '/' + path
8282
phpSelection = 'PHP ' + php
8383

84-
result = virtualHostUtilities.createDomain(masterDomain, domainName, phpSelection, path, ssl, dkim,
85-
openBasedir, owner, 0)
84+
result = virtualHostUtilities.createDomain(masterDomain, domainName, phpSelection, complete_path, ssl, dkim, openBasedir, owner, 0)
8685

8786
if result[0] == 1:
8887
self.printStatus(1, 'None')
@@ -920,8 +919,13 @@ def main():
920919
openBasedir = int(args.openBasedir)
921920
else:
922921
openBasedir = 0
922+
923+
if args.path:
924+
path = args.path
925+
else:
926+
path = "public_html/" + args.childDomain
923927

924-
cyberpanel.createDomain(args.masterDomain, args.childDomain, args.owner, args.php, ssl, dkim, openBasedir)
928+
cyberpanel.createDomain(args.masterDomain, args.childDomain, args.owner, args.php, ssl, dkim, openBasedir, path)
925929
elif args.function == "deleteChild":
926930

927931
completeCommandExample = 'cyberpanel deleteChild --childDomain cyberpanel.net'

0 commit comments

Comments
 (0)