mirror of
https://github.com/wimpysworld/stream-sprout
synced 2026-03-14 22:55:49 +01:00
feat: trap more signals
This commit is contained in:
parent
18c13219c0
commit
cc928c2565
1 changed files with 3 additions and 3 deletions
|
|
@ -7,7 +7,7 @@ stty -echoctl
|
|||
readonly STREAM_SPROUT_YAML="stream-sprout.yaml"
|
||||
readonly VERSION="0.1.4"
|
||||
|
||||
function ctrl_c() {
|
||||
function cleanup() {
|
||||
echo -e " \e[31m\U26D4\e[0m Control-C"
|
||||
sleep 0.25
|
||||
if kill -0 "${FFMPEG_PID}" 2>/dev/null; then
|
||||
|
|
@ -137,8 +137,8 @@ else
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# trap ctrl-c and call ctrl_c() to clean up
|
||||
trap ctrl_c INT
|
||||
# trap relevant signals and call cleanup()
|
||||
trap cleanup INT QUIT TERM
|
||||
|
||||
banner
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue