Merge pull request #167 from 0b100100/patch-1

wait until the transmission-daemon terminates properly
This commit is contained in:
aptalca
2021-07-25 13:10:21 -04:00
committed by GitHub
2 changed files with 5 additions and 0 deletions

View File

@@ -79,6 +79,7 @@ app_setup_block: |
# changelog
changelogs:
- { date: "09.07.21:", desc: "Wait for the transmission-daemon termination after a caught sigterm" }
- { date: "06.03.21:", desc: "Add Flood for Transmission as a UI option" }
- { date: "23.01.21:", desc: "Rebasing to alpine 3.13." }
- { date: "02.11.20:", desc: "Add ca-certificates package to allow connecting to https trackers." }

View File

@@ -2,11 +2,15 @@
_term() {
echo "Caught SIGTERM signal!"
echo "Tell the transmission session to shut down."
pid=$(pidof transmission-daemon)
if [ ! -z "$USER" ] && [ ! -z "$PASS" ]; then
/usr/bin/transmission-remote -n "$USER":"$PASS" --exit
else
/usr/bin/transmission-remote --exit
fi
# terminate when the transmission-daemon process dies
tail --pid=${pid} -f /dev/null
}
trap _term SIGTERM