Updated scripts based on latest release of docker-transmission-openvpn, updated Dockerfile, fetches now vpn config externally
This commit is contained in:
@@ -13,15 +13,32 @@ then
|
||||
log "/config/deluge-pre-stop.sh returned $?"
|
||||
fi
|
||||
|
||||
log "Sending kill signal to deluge-web"
|
||||
PID=$(pgrep deluge-web)
|
||||
kill "$PID"
|
||||
|
||||
log "Sending kill signal to deluge-daemon"
|
||||
PID=$(pidof /usr/bin/python3 /usr/bin/deluged)
|
||||
kill -9 $PID
|
||||
# Give deluge-daemon time to shut down
|
||||
for i in {1..10}; do
|
||||
ps -p $PID &> /dev/null || break
|
||||
sleep .2
|
||||
PID=$(pgrep deluged)
|
||||
kill "$PID"
|
||||
|
||||
# Give deluged some time to shut down
|
||||
DELUGE_TIMEOUT_SEC=${DELUGE_TIMEOUT_SEC:-5}
|
||||
for i in $(seq "$DELUGE_TIMEOUT_SEC")
|
||||
do
|
||||
sleep 1
|
||||
[[ -z "$(pgrep deluged)" ]] && break
|
||||
[[ $i == 1 ]] && echo "Waiting ${DELUGE_TIMEOUT_SEC}s for deluged to die"
|
||||
done
|
||||
|
||||
# Check whether deluged is still running
|
||||
if [[ -z "$(pgrep deluged)" ]]
|
||||
then
|
||||
echo "Successfuly closed deluged"
|
||||
else
|
||||
echo "Sending kill signal (SIGKILL) to deluged"
|
||||
kill -9 "$PID"
|
||||
fi
|
||||
|
||||
# If deluge-post-stop.sh exists, run it
|
||||
if [[ -x /config/deluge-post-stop.sh ]]
|
||||
then
|
||||
|
Reference in New Issue
Block a user