pause download if not connected to a specific ip adress

Discuss newly added features or request new features.
Post Reply
John2
Posts: 6
Joined: 04 Aug 2016, 13:46

pause download if not connected to a specific ip adress

Post by John2 » 04 Aug 2016, 13:59

Hello,

Is it possible to add an ip-check when downloading? I'am using a VPN provider, but sometimes my VPN connection gets lost.
In case that happens i want my downloads to stop untill my VPN comes up again.

Is it possible to implement that in a next version or in a scheduled script?

Thanks,
John

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: pause download if not connected to a specific ip adress

Post by hugbug » 04 Aug 2016, 14:12

You can write a scheduler script for that.
A better solution would be to adjust your routing table to use VPN for news-server IP-address.
Google for "routing table <your-os>".

John2
Posts: 6
Joined: 04 Aug 2016, 13:46

Re: pause download if not connected to a specific ip adress

Post by John2 » 04 Aug 2016, 16:03

I'm running the vpn on my router, so all my traffic is behind vpn. i'm googling your suggestion, but cannot figure out exactly how this could help me additionally to my setup.

I've been looking around for a day or two on the site and the forum, but cannot find the script parameters to pause and restart nzbget.
I'm also very inexperienced on creating scripts in bash and even more inexperienced in python, but i like to puzzle ;-)
Can you give me some help or links where i can pickup some more information on the pause and restart syntax?

Thank you!!

Btw: Awesome program!! :D

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: pause download if not connected to a specific ip adress

Post by hugbug » 04 Aug 2016, 16:51

Have you looked in the docs already? Specifically this page - https://github.com/nzbget/nzbget/wiki/C ... nd---pause.


I thought VPN was provided locally on PC, in which case it is usually sean as a second network interface which can be used in routing rules. Maybe you can create routing rules on router as well. I'm not a specalist in this area however.

What happens if router drops VPN connection? Does all the trafic go via normal connection then? I suppose so, because if the internet generally doesn't work without VPN why bother with pausing nzbget.

John2
Posts: 6
Joined: 04 Aug 2016, 13:46

Re: pause download if not connected to a specific ip adress

Post by John2 » 04 Aug 2016, 18:06

Indeed,
When the connection is dropped all traffic goes through the normal connection. So you're correct.

I saw the information from your link earlier, but I'm running nzbget as a deamon from a qnap package. That deamon only allows {start|stop|restart|showtaginfo}.
I'll try what happens if i start directly from the program and test for the ip in a bash script.

Thank you very much!!

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: pause download if not connected to a specific ip adress

Post by hugbug » 04 Aug 2016, 18:54

You don't have to start in console. Although the daemon-script has only "start|stop|restart|showtaginfo" at the end it just starts nzbget-binary. As long as nzbget is running you can use all nzbget commands, you pass them to nzbget-binary, not to the daemon-script, for example:

Code: Select all

/path/to/nzbget -P
or (if the above doesn't work):

Code: Select all

/path/to/nzbget -c /path/to/nzbget.conf -P

John2
Posts: 6
Joined: 04 Aug 2016, 13:46

Re: pause download if not connected to a specific ip adress

Post by John2 » 05 Aug 2016, 08:16

ok thanks, The first option worked for me. Now on to the script!

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests