From dcf2b1bda1eb552764f612d075ef6bb60166f4dc Mon Sep 17 00:00:00 2001 From: binhex Date: Mon, 12 Nov 2018 13:23:59 +0000 Subject: [PATCH] set port and ip for next run --- run/nobody/qbittorrent.sh | 10 ++++++++++ run/nobody/watchdog.sh | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/run/nobody/qbittorrent.sh b/run/nobody/qbittorrent.sh index 702fbf7..162be47 100644 --- a/run/nobody/qbittorrent.sh +++ b/run/nobody/qbittorrent.sh @@ -8,6 +8,10 @@ if [[ "${qbittorrent_running}" == "true" ]]; then curl -i -X POST -d "json=%7B%22random_port%22%3Afalse%7D" "http://localhost:${WEBUI_PORT}/command/setPreferences" &> /dev/null curl -i -X POST -d "json=%7B%22listen_port%22%3A${VPN_INCOMING_PORT}%7D" "http://localhost:${WEBUI_PORT}/command/setPreferences" &> /dev/null + + # set qbittorrent port to current vpn port (used when checking for changes on next run) + qbittorrent_port="${VPN_INCOMING_PORT}" + fi @@ -65,6 +69,12 @@ else curl -i -X POST -d "json=%7B%22random_port%22%3Afalse%7D" "http://localhost:${WEBUI_PORT}/command/setPreferences" &> /dev/null curl -i -X POST -d "json=%7B%22listen_port%22%3A${VPN_INCOMING_PORT}%7D" "http://localhost:${WEBUI_PORT}/command/setPreferences" &> /dev/null + # set rtorrent port to current vpn port (used when checking for changes on next run) + qbittorrent_port="${VPN_INCOMING_PORT}" + fi fi + +# set qbittorrent ip to current vpn ip (used when checking for changes on next run) +qbittorrent_ip="${vpn_ip}" diff --git a/run/nobody/watchdog.sh b/run/nobody/watchdog.sh index a342c93..867f55a 100644 --- a/run/nobody/watchdog.sh +++ b/run/nobody/watchdog.sh @@ -49,7 +49,7 @@ while true; do # if current bind interface ip is different to tunnel local ip then re-configure qbittorrent if [[ "${qbittorrent_ip}" != "${vpn_ip}" ]]; then - echo "[info] qBittorrent listening interface IP $qbittorrent_ip and VPN provider IP ${vpn_ip} different, marking for reconfigure" + echo "[info] qBittorrent listening interface IP ${qbittorrent_ip} and VPN provider IP ${vpn_ip} different, marking for reconfigure" # mark as reload required due to mismatch ip_change="true"