Skip to content

Commit 4f2cb9f

Browse files
committed
install wordpress via cli
1 parent 2a16d76 commit 4f2cb9f

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

cli/cliParser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,10 @@ def prepareArguments(self):
6363
parser.add_argument('--securityLevel', help='Set security level while creating user.')
6464
parser.add_argument('--state', help='State value used in user suspension.')
6565

66+
67+
### WP Install
68+
69+
parser.add_argument('--siteTitle', help='Site Title for application installers.')
70+
parser.add_argument('--path', help='Path for application installers.')
71+
6672
return parser.parse_args()

cli/cyberPanel.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,51 @@ def main():
14711471

14721472
print(response.content.decode())
14731473

1474+
### Application installers
1475+
1476+
elif args.function == "installWordPress":
1477+
completeCommandExample = 'cyberpanel installWordPress --domainName cyberpanel.net --email support@cyberpanel.net --userName cyberpanel --password helloworld --siteTitle "WordPress Site" --path helloworld (this is optional)'
1478+
1479+
if not args.domainName:
1480+
print("\n\nPlease enter Domain name. For example:\n\n" + completeCommandExample + "\n\n")
1481+
return
1482+
1483+
if not args.email:
1484+
print("\n\nPlease enter email. For example:\n\n" + completeCommandExample + "\n\n")
1485+
return
1486+
1487+
if not args.userName:
1488+
print("\n\nPlease enter User name. For example:\n\n" + completeCommandExample + "\n\n")
1489+
return
1490+
1491+
if not args.password:
1492+
print("\n\nPlease enter password. For example:\n\n" + completeCommandExample + "\n\n")
1493+
return
1494+
1495+
if not args.siteTitle:
1496+
print("\n\nPlease enter site title. For example:\n\n" + completeCommandExample + "\n\n")
1497+
return
1498+
1499+
if not args.path:
1500+
home = '1'
1501+
path = ''
1502+
else:
1503+
home = '0'
1504+
path = args.path
1505+
1506+
from websiteFunctions.website import WebsiteManager
1507+
1508+
data = {}
1509+
data['adminUser'] = args.userName
1510+
data['blogTitle'] = args.siteTitle
1511+
data['domain'] = args.domainName
1512+
data['adminEmail'] = args.email
1513+
data['passwordByPass'] = args.password
1514+
data['home'] = home
1515+
data['path'] = path
1516+
1517+
wm = WebsiteManager()
1518+
wm.installWordpress(1, data)
14741519

14751520

14761521

0 commit comments

Comments
 (0)