Add -D cli arg to tolerate disconnections on startup

This commit is contained in:
jesopo 2019-07-04 13:32:08 +01:00
parent 43c8ad0ff6
commit d7e18b1826

View file

@ -43,6 +43,9 @@ arg_parser.add_argument("--module", "-m",
arg_parser.add_argument("--module-args", "-M",
help="Arguments to give in action against a specific module")
arg_parser.add_argument("--startup-disconnects", "-D",
help="Tolerate failed connections on startup", action="store_true")
args = arg_parser.parse_args()
if args.version:
@ -101,8 +104,8 @@ if len(server_configs):
for server in servers:
if not bot.connect(server):
sys.stderr.write("failed to connect to '%s', exiting\r\n" % (
str(server)))
log.error("Failed to connect to '%s'" % str(server))
if not args.startup_disconnects:
sys.exit(1)
try: