mirror of
https://github.com/MarkusMcNugen/docker-qBittorrentvpn
synced 2024-12-24 10:01:40 +00:00
Update start.sh
This commit is contained in:
parent
7effb3cb97
commit
07cdebca75
@ -1,10 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
_handler() {
|
||||
echo "[warn] Shutdown detected... cleaning up real quick!" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
# if config directory exists, apply permissions before exiting
|
||||
chmod -R 755 /config/qBittorrent
|
||||
handler() {
|
||||
echo "[warn] Shutdown detected..." | ts '%Y-%m-%d %H:%M:%.S'
|
||||
}
|
||||
|
||||
if [[ ! -e /config/qBittorrent ]]; then
|
||||
@ -22,16 +20,13 @@ fi
|
||||
|
||||
echo "[info] Starting qBittorrent daemon..." | ts '%Y-%m-%d %H:%M:%.S'
|
||||
/bin/bash /etc/qbittorrent/qbittorrent.init start &
|
||||
echo "[info] Started qBittorrent daemon..." | ts '%Y-%m-%d %H:%M:%.S'
|
||||
chmod -R 755 /config/qBittorrent
|
||||
|
||||
child=$(pgrep -o -x qbittorrent-nox)
|
||||
echo "[info] qbittorrent-nox PID: $child" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
echo "[info] qBittorrent PID: $child" | ts '%Y-%m-%d %H:%M:%.S'
|
||||
|
||||
while true; do
|
||||
if [ -e /proc/$child ]; then
|
||||
sleep 0.1
|
||||
else
|
||||
_handler
|
||||
fi
|
||||
done
|
||||
if [ -e /proc/$child ]; then
|
||||
sleep infinity
|
||||
else
|
||||
echo "qBittorrent failed to start!"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user