Skip to content

Commit

Permalink
tryfix portforwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhotio committed Feb 3, 2024
1 parent 1fc07fc commit 30ab467
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion root/app/forwarded_port_update_app
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ if grep -q 'WebUI\\HTTPS\\Enabled=true' "${CONFIG_DIR}/config/qBittorrent.conf";
webui_https="https"
fi
if grep -q 'WebUI\\LocalHostAuth=false' "${CONFIG_DIR}/config/qBittorrent.conf"; then
curl -fsSL --insecure -X POST -d "json={\"web_ui_upnp\":false,\"upnp\":false,\"random_port\":false,\"listen_port\":${port}}" "${webui_https}://localhost:${WEBUI_PORTS%%/*}/api/v2/app/setPreferences"
if ! curl -fsSL --retry 5 --retry-max-time 60 --insecure -X POST -d "json={\"web_ui_upnp\":false,\"upnp\":false,\"random_port\":false,\"listen_port\":${port}}" "${webui_https}://localhost:${WEBUI_PORTS%%/*}/api/v2/app/setPreferences"; then
echo "[ERROR] [$(date '+%Y-%m-%d %H:%M:%S')] Unable to set forwarded port in qBittorrent, something is wrong!"
rm -rf "${CONFIG_DIR}/wireguard/forwarded_port"
fi
else
echo "[WARNING] [$(date '+%Y-%m-%d %H:%M:%S')] Unable to set forwarded port in qBittorrent, \"LocalHostAuth\" is enabled!"
rm -rf "${CONFIG_DIR}/wireguard/forwarded_port"
fi

0 comments on commit 30ab467

Please sign in to comment.