Hi,
I have been using a script to find the forwarded port for my VPN provider. It uses the deluge-console command to do so and the port to use is the result of running another script which finds and outputs the port. It has worked well and I have run the script when a torrent is added using the execute plugin. The problem is that the output format from the script that finds the port now has changed and I am not able to find out how to get it to work with the new port output. The script is very simple:
#! /bin/bash
PORT=`/home/user/scripts/port.sh
deluge-console "config --set random_port False"
deluge-console "config --set listen_ports ($PORT $PORT)"
With the original port.sh script the output was simple, a port number like 34322. But the new port.sh script puts out the port in another format: {"port":34322}. How do I edit the script to be able to pick up the port number and pass it on to Deluge?
Setting incoming port based on script output.
Re: Setting incoming port based on script output.
Passing the output of port.sh through tr -d -c [:digit:] will remove all characters except digits.
Re: Setting incoming port based on script output.
Thanks! I do not think I have enough script knowledge to make it work. I did get the correct port output from port.sh by using tr but I do not get the "deluge-console "config --set listen_ports ($PORT $PORT)"" line to pick up the output and pass it on to Deluge. If you have any idea how to make that work please let me know.
Re: Setting incoming port based on script output.
I know this is an old thread, but I it found while looking for a similar answer.
Apparently the listen_ports is actually a range, not a single port. To set a range with deluge-console config, use [xxx,yyy]
so:
deluge-console config --set listen_ports [$PORT,$PORT]
Apparently the listen_ports is actually a range, not a single port. To set a range with deluge-console config, use [xxx,yyy]
so:
deluge-console config --set listen_ports [$PORT,$PORT]