better logging for retries, set return not exit code

pull/23/merge
binhex 4 years ago
parent 4a5572df66
commit 912a2fc753

@ -11,7 +11,8 @@ if [[ "${qbittorrent_running}" == "false" ]]; then
/usr/bin/qbittorrent-nox --daemon --webui-port="${WEBUI_PORT}" --profile=/config /usr/bin/qbittorrent-nox --daemon --webui-port="${WEBUI_PORT}" --profile=/config
# make sure process qbittorrent-nox DOES exist # make sure process qbittorrent-nox DOES exist
retry_count=30 retry_count=12
retry_wait=1
while true; do while true; do
if ! pgrep -x "qbittorrent-nox" > /dev/null; then if ! pgrep -x "qbittorrent-nox" > /dev/null; then
@ -20,16 +21,17 @@ if [[ "${qbittorrent_running}" == "false" ]]; then
if [ "${retry_count}" -eq "0" ]; then if [ "${retry_count}" -eq "0" ]; then
echo "[warn] Wait for qBittorrent process to start aborted, too many retries" echo "[warn] Wait for qBittorrent process to start aborted, too many retries"
echo "[warn] Showing output from command before exit..." echo "[info] Showing output from command before exit..."
timeout 10 yes | /usr/bin/qbittorrent-nox --webui-port="${WEBUI_PORT}" --profile=/config ; exit 1 timeout 10 yes | /usr/bin/qbittorrent-nox --webui-port="${WEBUI_PORT}" --profile=/config ; return 1
else else
if [[ "${DEBUG}" == "true" ]]; then 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 fi
sleep "${retry_wait}s"
sleep 1s
fi fi

Loading…
Cancel
Save