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