From de35154bc4caa7b364dafa668362a55cee2030ba Mon Sep 17 00:00:00 2001 From: "k.eaven" Date: Wed, 13 Aug 2025 00:00:30 -0700 Subject: [PATCH] Modify container signal handling --- entrypoint.sh | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 33f94c4..af850b3 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,16 +1,8 @@ #!/bin/sh -# Run the application in the background -python generate_config.py && python pterodisbot.py & +if ! python generate_config.py; then + echo "Failed to generate config" + exit 1 +fi -# Capture the application's process ID -PID=$! - -# Trap SIGTERM (from Docker) and convert it to SIGINT (for Python) -trap "echo 'Received SIGTERM, converting to SIGINT'; kill -SIGINT $PID" SIGTERM - -# Also trap SIGINT (for manual Ctrl+C) and forward it -trap "kill -SIGINT $PID" SIGINT - -# Wait for the process to exit -wait $PID \ No newline at end of file +exec python pterodisbot.py \ No newline at end of file