From bb299331651f3e2f57f65698c33f9981385d8c1d Mon Sep 17 00:00:00 2001 From: AmiOta <46223934+AmiOta@users.noreply.github.com> Date: Sun, 22 Nov 2020 18:41:05 -0500 Subject: [PATCH] Duplicate SSH User command createWebsite CLI version #450 Solve #450 --- cli/cyberPanel.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cli/cyberPanel.py b/cli/cyberPanel.py index afc260955..1ac06edd8 100755 --- a/cli/cyberPanel.py +++ b/cli/cyberPanel.py @@ -42,6 +42,17 @@ class cyberPanel: from random import randint externalApp = "".join(re.findall("[a-zA-Z]+", domainName))[:5] + str(randint(1000, 9999)) phpSelection = 'PHP ' + php + + try: + counter = 0 + _externalApp=externalApp + while True: + tWeb = Websites.objects.get(externalApp=externalApp) + externalApp = '%s%s' % (_externalApp, str(counter)) + counter = counter + 1 + except BaseException as msg: + logger.writeforCLI(str(msg), "Error", stack()[0][3]) + time.sleep(2) result = virtualHostUtilities.createVirtualHost(domainName, email, phpSelection, externalApp, ssl, dkim, openBasedir, owner, package, 0) @@ -1556,4 +1567,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main()