Deluge and VPN

Suggest, post, or discuss plugins for Deluge
vapulabis
New User
New User
Posts: 3
Joined: Sat Nov 03, 2018 1:30 pm
OS or Distro: Linux Mint 17

Deluge and VPN

Postby vapulabis » Sat Nov 03, 2018 1:39 pm

Hello

I have looked for a while now and unless I am blind to seeing it, I cannot find a plugin to do what I would like it to do unless someone can point me at it, my internet at the moment is dodgy dropping in and out, I use a VPN with Deluge on an old Linux laptop running Linux Mint 17 and it runs 24 hours a day. My problem is that when the internet drops, the VPN disables, but Deluge keeps running, and when the internet comes back on, the VPN does not start automatically so I end up with my Deluge laptop seeding and downloading without a VPN, so what I would like is for Deluge to turn itself off when my internet drops out to save any problems. is this a possibility?

TIA Vapulabis

User avatar
gderf
Leecher
Leecher
Posts: 88
Joined: Sat Jun 18, 2016 1:32 am
OS or Distro: Debian Linux

Re: Deluge and VPN

Postby gderf » Mon Nov 05, 2018 1:01 am

Search the forum on the word "killswitch"

vapulabis
New User
New User
Posts: 3
Joined: Sat Nov 03, 2018 1:30 pm
OS or Distro: Linux Mint 17

Re: Deluge and VPN

Postby vapulabis » Mon Nov 05, 2018 8:21 pm

I created my own killswitch, I created a BASH file called killdeluge.sh and created a cron job to run it

Code: Select all

#!/bin/bash
if ! (ping -q -c 1 -W 1 8.8.8.8 >/dev/null); then
pkill deluge
fi


made the file executable (chmod 755)

created a cronjob to run every minute

Code: Select all

1 * * * * sh /Mine/MyFolder/stopdeluge.sh

vapulabis
New User
New User
Posts: 3
Joined: Sat Nov 03, 2018 1:30 pm
OS or Distro: Linux Mint 17

Re: Deluge and VPN

Postby vapulabis » Tue Nov 06, 2018 12:30 am

unfortunately attempt number one didn’t work so I had to rethink it

Code: Select all

#!/bin/bash
if ! (ping -W 1 8.8.8.8 >/dev/null); then
pkill deluge
fi


moved it to /usr/local/bin and chmod+x

then crontab now reads

Code: Select all

* * * * * /usr/local/bin/stopdeluge.sh


and it now works a treat, within 90 seconds of me pulling the internet from the laptop, deluge gets turned off, this is well within the time it takes for my router to be back up running and connected to the internet for it to get a ping, so if we have a power cut or the internet drops out Deluge will not be running when the internet gets back


Return to “Plugins”

Who is online

Users browsing this forum: No registered users and 2 guests