Scheduler - Pause downloading when VPN connection dropped

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
Post Reply
John2
Posts: 6
Joined: 04 Aug 2016, 13:46

Scheduler - Pause downloading when VPN connection dropped

Post by John2 » 09 Aug 2016, 10:10

This script checks the current IP from which you are connecting to the internet.
If the IP is your own (non-VPN) ip address it pauses downloading. When it is connected to VPN again it resumes downloading.
I am very novice on writing scripts, and my programming knowledge is almost as ancient as the egyptian pyramids, so this can surely be done with much less code ....
Also i couldn't manage to set the parameters from within NZBget, so you'll have to enter them in the script. The lines to edit in the script are the ones shown below.

I hope some one can use this script

John

Code: Select all

# Temporary file for storing actual ip address last time the script was run, used to determine if the ip address changed so action is required
cIpFile="/share/MD0_DATA/Download/nzbToMedia/NZBGet.ip"
# The start range for your own (non-VPN) ip address for example "74." or "95.100." or a full address like "74.125.206.99"
cOwnIpStartRange="74."
# The command to execute NZBget, including full path.
cExecute="/share/MD0_DATA/.qpkg/NZBGet/nzbget/nzbget"
Attachments
NzbgVpn_publish.sh
(3.52 KiB) Downloaded 295 times

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests