port=config.HTTP_PORT, pem=config.SSL_PEM if config.USE_SSL else None, join=True) except KeyboardInterrupt: print("\r[x] stopping (Ctrl-C pressed)") if __name__ == "__main__": show_final = True try: main() except SystemExit as ex: show_final = False if isinstance(get_ex_message(ex), six.string_types): print(get_ex_message(ex)) os._exit(1) except Exception: msg = "\r[!] unhandled exception occurred ('%s')" % sys.exc_info()[1] msg += "\n[x] please report the following details at 'https://github.com/stamparm/maltrail/issues':\n---\n'%s'\n---" % traceback.format_exc( ) log_error("\n\n%s" % msg.replace("\r", "")) print(msg) finally: if show_final: print("[i] finished") os._exit(0)
port=config.HTTP_PORT, pem=config.SSL_PEM if config.USE_SSL else None, join=True) except KeyboardInterrupt: print("\r[x] stopping (Ctrl-C pressed)") if __name__ == "__main__": show_final = True try: main() except SystemExit as ex: show_final = False if isinstance(get_ex_message(ex), six.string_types) and get_ex_message(ex).strip('0'): print(get_ex_message(ex)) os._exit(1) except Exception: msg = "\r[!] unhandled exception occurred ('%s')" % sys.exc_info()[1] msg += "\n[x] please report the following details at 'https://github.com/stamparm/maltrail/issues':\n---\n'%s'\n---" % traceback.format_exc( ) log_error("\n\n%s" % msg.replace("\r", "")) print(msg) finally: if show_final: print("[i] finished") os._exit(0)