aboutsummaryrefslogtreecommitdiff
path: root/start.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-07-04 13:32:08 +0100
committerGravatar jesopo2019-07-04 13:32:08 +0100
commitd7e18b182645f287a0d6c6b440beb6a2a8b70d93 (patch)
tree1a17b98637a29070a457624ed3fb654009e82a74 /start.py
parentAdd !editserver command (diff)
signature
Add -D cli arg to tolerate disconnections on startup
Diffstat (limited to 'start.py')
-rwxr-xr-xstart.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/start.py b/start.py
index aa3bee70..2f745ab8 100755
--- a/start.py
+++ b/start.py
@@ -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,9 +104,9 @@ 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)))
- sys.exit(1)
+ log.error("Failed to connect to '%s'" % str(server))
+ if not args.startup_disconnects:
+ sys.exit(1)
try:
bot.run()