[Solved]
Mar 09, 2021, 08:58 PM
(This post was last modified: Mar 09, 2021, 09:00 PM by UPforum.)
Well, after many failed attempts, i got this thing to work.
Utilizing Post #5 from here, i download the pia-portforward.sh.txt script.
I may not have grabbed an updated script, so maybe that is the reason : It wasn't passing the argument of the port # like it said it does.
I made the following modification :
I added the $pf_port at the end of the line.
I turned it into a service as described, but also made modifications to that file :
My VPN service name is openvpn@Netherlands, of course yours would be different.
I also modified the After= to include additional services i wished to wait for.
As per post #5, i also modified the portforward.sh further to grab the port from the argument passed, and simplified it for my particular needs.
The result : After 6 months of no port forwarding, Its working again!!!!! I have verified after multiple reboots of DELUGE and the service is starting and fetching a port, and then updating DELUGE. I have verified via the Deluge Preferences / Network Tab [Test Active Port] button and wala! I have people downloading from me again and my torrents have improved GREATLY.
I posted this just in case this might help someone. Thank for for all the work that was done on this Forum Thread.
Utilizing Post #5 from here, i download the pia-portforward.sh.txt script.
I may not have grabbed an updated script, so maybe that is the reason : It wasn't passing the argument of the port # like it said it does.
I made the following modification :
I added the $pf_port at the end of the line.
Code:
# Run another script if requested
[ -n "$post_script" ] && echo "$(date): Running $post_script" && eval "$post_script $pf_port"
My VPN service name is openvpn@Netherlands, of course yours would be different.
I also modified the After= to include additional services i wished to wait for.
Code:
[Unit]
Description=PIA Port Forwarding Daemon
After=network-online.target openvpn@Netherlands deluged.service
[Service]
SyslogIdentifier=pia-pf
Restart=always
RestartSec=5
Type=simple
WorkingDirectory=/etc/openvpn
ExecStartPre=/bin/sleep 10
ExecStart=/etc/openvpn/pia.sh -f tun0 -p /etc/openvpn/port.dat -s /etc/openvpn/setport.sh
TimeoutStopSec=30
[Install]
WantedBy=multi-user.target
Code:
#request new port
PORT=$1
if [ -z "$1" ]
then
echo "No argument supplied - grabbing port from PORT.DAT file"
PORT=$(cat /etc/openvpn/port.dat)
fi
echo ==========================
echo DELUGE SET PORT TO : $PORT
echo ==========================
#change deluge port on the fly
result="$PORT,$PORT"
deluge-console "connect 192.168.1.51 admin password; config -s listen_ports ($result)"
The result : After 6 months of no port forwarding, Its working again!!!!! I have verified after multiple reboots of DELUGE and the service is starting and fetching a port, and then updating DELUGE. I have verified via the Deluge Preferences / Network Tab [Test Active Port] button and wala! I have people downloading from me again and my torrents have improved GREATLY.
I posted this just in case this might help someone. Thank for for all the work that was done on this Forum Thread.
