From cc90c4f4ab75e3bd4f64f1a3ab43d1f8580b44c3 Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Thu, 9 Mar 2023 03:29:21 -0500 Subject: [PATCH] [O] Check file perms on launch --- relay.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/relay.py b/relay.py index ea96ccb..2eb6f58 100644 --- a/relay.py +++ b/relay.py @@ -96,6 +96,11 @@ if __name__ == '__main__': parser.add_argument('--bin', type=str, default='./tngame-rs/target/release/tngame-rs') args = parser.parse_args() + # Check if bin file exists and is executable + if not os.path.isfile(args.bin) or not os.access(args.bin, os.X_OK): + log.error(f"Binary file {args.bin} does not exist or is not executable.") + exit(1) + # Create a new event loop, start the server and wait for it to close print(f"Starting server on port {args.port}.") loop = asyncio.new_event_loop()