From 0f0924281c15327a4c10bb57bb3f9e7a545095c0 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 25 Oct 2019 14:13:48 +0100 Subject: use different exit codes for every error circumstance --- bitbotd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bitbotd') diff --git a/bitbotd b/bitbotd index a78cbd66..7bd15e73 100755 --- a/bitbotd +++ b/bitbotd @@ -86,7 +86,7 @@ log.info("Starting BitBot %s (Python v%s, db %s)", lock_file = LockFile.LockFile(lock_location) if not lock_file.available(): log.critical("Database is locked. Is BitBot already running?") - sys.exit(1) + sys.exit(2) atexit.register(lock_file.unlock) lock_file.lock() @@ -159,13 +159,13 @@ if len(server_configs): if not bot.connect(server): log.error("Failed to connect to '%s'" % str(server)) if not args.startup_disconnects: - sys.exit(1) + sys.exit(3) try: bot.run() except Exception as e: log.critical("Unhandled exception: %s", [str(e)], exc_info=True) - sys.exit(1) + sys.exit(4) else: try: if utils.cli.bool_input("no servers found, add one?"): -- cgit v1.3.1-10-gc9f91