Skip to content

Instantly share code, notes, and snippets.

@lionello
Last active February 11, 2023 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lionello/3bba82be7774560ec2cef70583cdcbad to your computer and use it in GitHub Desktop.
Save lionello/3bba82be7774560ec2cef70583cdcbad to your computer and use it in GitHub Desktop.
Shell script to wait for a signal
#!/usr/bin/env python
import signal, subprocess, sys
signal.sigwait([signal.SIGTERM])
#!/usr/bin/env sh
trap 'exit 0' $1 || exit $?
while true; do
read -r line
done
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment