Deluge and VPN

Suggest, post, or discuss plugins for Deluge
Post Reply
vapulabis
New User
New User
Posts: 3
Joined: Sat Nov 03, 2018 1:30 pm

Deluge and VPN

Post by vapulabis »

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
Seeder
Seeder
Posts: 155
Joined: Sat Jun 18, 2016 1:32 am

Re: Deluge and VPN

Post by gderf »

Search the forum on the word "killswitch"
vapulabis
New User
New User
Posts: 3
Joined: Sat Nov 03, 2018 1:30 pm

Re: Deluge and VPN

Post by vapulabis »

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

Re: Deluge and VPN

Post by vapulabis »

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
Post Reply