@@ -61,15 +61,16 @@ class Modoboa(base.Installer):
|
||||
"""Deploy Modoboa."""
|
||||
target = os.path.join(self.home_dir, "instance")
|
||||
if os.path.exists(target):
|
||||
utils.printcolor(
|
||||
"Target directory for Modoboa deployment ({}) already exists."
|
||||
" If you choose to continue, it will be removed.".format(
|
||||
target),
|
||||
utils.YELLOW
|
||||
)
|
||||
answer = utils.user_input("Do you confirm? (Y/n) ")
|
||||
if answer.lower().startswith("n"):
|
||||
return
|
||||
if not self.config.getboolean("general", "force"):
|
||||
utils.printcolor(
|
||||
"Target directory for Modoboa deployment ({}) already "
|
||||
"exists. If you choose to continue, it will be removed."
|
||||
.format(target),
|
||||
utils.YELLOW
|
||||
)
|
||||
answer = utils.user_input("Do you confirm? (Y/n) ")
|
||||
if answer.lower().startswith("n"):
|
||||
return
|
||||
shutil.rmtree(target)
|
||||
|
||||
prefix = ". {}; ".format(
|
||||
|
||||
@@ -29,10 +29,11 @@ class SelfSignedCertificate(CertificateBackend):
|
||||
def create(self):
|
||||
"""Create a certificate."""
|
||||
if os.path.exists(self.config.get("general", "tls_key_file")):
|
||||
answer = utils.user_input(
|
||||
"Overwrite the existing SSL certificate? (y/N) ")
|
||||
if not answer.lower().startswith("y"):
|
||||
return
|
||||
if not self.config.getboolean("general", "force"):
|
||||
answer = utils.user_input(
|
||||
"Overwrite the existing SSL certificate? (y/N) ")
|
||||
if not answer.lower().startswith("y"):
|
||||
return
|
||||
utils.printcolor(
|
||||
"Generating new self-signed certificate", utils.YELLOW)
|
||||
utils.exec_cmd(
|
||||
|
||||
Reference in New Issue
Block a user