diff --git a/run/nobody/qbittorrent.sh b/run/nobody/qbittorrent.sh index 85c7ad8..7c8a936 100644 --- a/run/nobody/qbittorrent.sh +++ b/run/nobody/qbittorrent.sh @@ -11,7 +11,8 @@ if [[ "${qbittorrent_running}" == "false" ]]; then /usr/bin/qbittorrent-nox --daemon --webui-port="${WEBUI_PORT}" --profile=/config # make sure process qbittorrent-nox DOES exist - retry_count=30 + retry_count=12 + retry_wait=1 while true; do if ! pgrep -x "qbittorrent-nox" > /dev/null; then @@ -20,16 +21,17 @@ if [[ "${qbittorrent_running}" == "false" ]]; then if [ "${retry_count}" -eq "0" ]; then echo "[warn] Wait for qBittorrent process to start aborted, too many retries" - echo "[warn] Showing output from command before exit..." - timeout 10 yes | /usr/bin/qbittorrent-nox --webui-port="${WEBUI_PORT}" --profile=/config ; exit 1 + echo "[info] Showing output from command before exit..." + timeout 10 yes | /usr/bin/qbittorrent-nox --webui-port="${WEBUI_PORT}" --profile=/config ; return 1 else if [[ "${DEBUG}" == "true" ]]; then - echo "[debug] Waiting for qBittorrent process to start..." + echo "[debug] Waiting for qBittorrent process to start" + echo "[debug] Re-check in ${retry_wait} secs..." + echo "[debug] ${retry_count} retries left" fi - - sleep 1s + sleep "${retry_wait}s" fi