mirror of
https://github.com/linuxserver/docker-transmission.git
synced 2025-11-02 01:35:47 +01:00
Merge pull request #167 from 0b100100/patch-1
wait until the transmission-daemon terminates properly
This commit is contained in:
@@ -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." }
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user