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