johntinic
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Store
Gallery
Bug Reports
Documentation
Landing
Posts posted by johntinic
-
-
I setup this container as COSTUM VPN.
added the option: -v /volume1/docker/sabnzbvpn/:/config/openvpn
add placed a few .ovpn files in de directory /volume1/docker/sabnzbvpn/
All works like a dream.
The question: but what terms is a .ovpn file picked in the directory /volume1/docker/sabnzbvpn/?
I seems it always the same one with a restart of the container.
Thanks
[Support] binhex - SABnzbdVPN
in Docker Containers
Posted · Edited by johntinic
Ok.. for the ones who want to randomize the their VPN connection:
randomizeSabnzbdVPN.sh
#!/bin/sh NOW=$(date +"%d-%m-%Y %H:%M") container="sabnzbdvpn" file=`ls /volume1/docker/sabnzbdvpn/ovpn/*.ovpn|sort -R|shuf -n 1` rm -rf /volume1/docker/sabnzbdvpn/config/openvpn/*.ovpn cp $file /volume1/docker/sabnzbdvpn/config/openvpn/ echo $NOW " - Cycling sabnzbdVPN to" $file >> /volume1/logging/vpn/vpn.log docker restart --time 10 $container
- this will pick randomized .ovpn file form the directory /volume1/docker/sabnzbdvpn/ovpn/
- Have all you *.ovpn at /volume1/docker/sabnzbdvpn/ovpn/
- make sure the set your docker config to /volume1/docker/sabnzbdvpn/config/openvpn/
- Name your container at $container
Then do a Crontab like so:
0 05 * * * root if [ "`date +%H`" == "05" ]; then sleep ${RANDOM:1:2}m; fi; /volume1/docker/sabnzbdvpn/scripts/randomizeSabnzbdVPN.sh > /dev/null 2>&1
This will randomize also the execution of the script by added a random number of minutes starting from 05H00.
Make sure if you want to change the HOUR, change in both in the hour option of crontab AND in the script in the IF-statement to the same hour.
This will give you the possibility on a SYNOLOGY to run script immediately on all hour by hand without the random minutes (except ofcourse at 05:00)