From 6dfa5efecc8bbf71543e63fee07403d02f0f7664 Mon Sep 17 00:00:00 2001 From: Jeffrey Serio Date: Tue, 25 Mar 2025 22:58:42 -0500 Subject: [PATCH] Configure qbittorrent with new port --- shell/natpmpcd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shell/natpmpcd b/shell/natpmpcd index 9c7d878..afc3d4d 100755 --- a/shell/natpmpcd +++ b/shell/natpmpcd @@ -1,6 +1,11 @@ #!/bin/sh -/usr/local/bin/natpmpc -a 1 0 udp 60 -g 10.2.0.1 | grep "Mapped public port" | awk '{print $4}' | tee /usr/local/etc/natvpn_port.txt +port=$(/usr/local/bin/natpmpc -a 1 0 udp 60 -g 10.2.0.1 | grep "Mapped public port" | awk '{print $4}') + +sed -i.bak 's|Session\\Port=[[:digit:]]*|Session\\Port='"${port}"'|g' /var/db/qbittorrent/conf/qBittorrent/config/qBittorrent.conf + +killall -HUP qbittorrent-nox +service qbittorrent start while true; do date