Created
April 26, 2025 12:55
-
-
Save Mons/6969a07dedd486d3c52a43727a3a17e6 to your computer and use it in GitHub Desktop.
entrypoint.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $$ -eq 1 ]; then | |
echo "Starting as init, set signal handlers..." | |
trap exit SIGTERM SIGINT | |
fi | |
set -ex | |
# prepare | |
set +x | |
if [ -z "$1" ]; then | |
echo "Sleeping..." | |
sleep infinity & | |
else | |
echo "Running command" | |
"$@" & | |
fi | |
wait %1 | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment