Last active
February 11, 2023 23:10
-
-
Save lionello/3bba82be7774560ec2cef70583cdcbad to your computer and use it in GitHub Desktop.
Shell script to wait for a signal
This file contains 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
#!/usr/bin/env python | |
import signal, subprocess, sys | |
signal.sigwait([signal.SIGTERM]) |
This file contains 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
#!/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