Added new option to generate config file.

fix #130
This commit is contained in:
Antoine Nguyen
2017-06-23 09:43:41 +02:00
parent 85aa37d7d5
commit 8052f4aede
4 changed files with 16 additions and 2 deletions

5
run.py
View File

@@ -23,6 +23,9 @@ def main():
help="Force installation")
parser.add_argument("--configfile", default="installer.cfg",
help="Configuration file to use")
parser.add_argument(
"--stop-after-configfile-check", action="store_true", default=False,
help="Check configuration, generate it if needed and exit")
parser.add_argument("domain", type=str,
help="The main domain of your future mail server")
args = parser.parse_args()
@@ -31,6 +34,8 @@ def main():
utils.ENV["debug"] = True
utils.printcolor("Welcome to Modoboa installer!", utils.GREEN)
utils.check_config_file(args.configfile)
if args.stop_after_configfile_check:
return
config = configparser.SafeConfigParser()
with open(args.configfile) as fp:
config.readfp(fp)