Files
pterodactyl-discord-bot/entrypoint.sh
k.eaven 1ce3f0d198
All checks were successful
Docker Build and Push / build-and-push (push) Successful in 1m12s
Modify container signal handling
2025-08-12 23:48:42 -07:00

16 lines
427 B
Bash

#!/bin/sh
# Run the application in the background
python generate_config.py && python pterodisbot.py &
# 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