From cc928c2565167a7a1fa0d4fffd4cdfd16cf7e0b1 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Tue, 23 Jul 2024 17:29:55 +0100 Subject: [PATCH] feat: trap more signals --- stream-sprout | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stream-sprout b/stream-sprout index b260c5d..5c241a1 100755 --- a/stream-sprout +++ b/stream-sprout @@ -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