You need to usermod and groupmod debian-transmission in the startup script to match the UID and GID of the plex account on the host. You also need to create the config tree as shown below.
Launch with docker run -dit --cap-add=NET_ADMIN -d -v /YOUR/STORAGE/PATH/HERE:/downloads -v /YOUR/CONFIG/PATH/HERE:/config vpntorrentbox /etc/rc.local
Config directory should contain:
/openvpn/.secret
/openvpn/profile.ovpn
/openvpn/various cert files
/scripts/startOpenvpn.sh
/scripts/startUp.sh
/scripts/tunnelPing.sh
/transmission/settings.safe
.secret in the openvpn folder is your credentials to your openvpn server, in the format:
USERNAME
PASSWORD
chmod this file to 400 profile.ovpn is your config file for your vpn service. it and the credential files will vary based on your selected service.
startOpenVPN.sh:
#/bin/bash
while true; do
echo $(date) starting >> /var/log/tun.log
#service transmission-daemon start
transmission-daemon -g /etc/transmission-daemon
openvpn /config/openvpn/profile.ovpn >> /var/log/tun.log
#service transmission-daemon stop
kill -9 $(ps -ef | grep transmission | awk '{print $2}')
echo $(date) stopped >> /var/log/tun.log
done
startUp.sh --- THIS IS WHERE TO UPDATE UID AND GID
#!/bin/bash
usermod -u 123 debian-transmission
groupmod -g 131 debian-transmission
cp /config/transmission/settings.safe /etc/transmission-daemon/settings.json
chown -R root:debian-transmission /etc/transmission-daemon
chown -R root:debian-transmission /var/lib/transmission-daemon
chown debian-transmission /etc/transmission-daemon/settings.json
mkdir -p /dev/net
mknod /dev/net/tun c 10 200
chmod 0666 /dev/net/tun
screen -dmS tunnelPing /config/scripts/tunnelPing.sh
screen -dmS openVPN /config/scripts/startOpenvpn.sh
while :
do
sleep 100
done
tunnelPing.sh:
#!/bin/bash
while true; do
echo nameserver 1.1.1.1 > /etc/resolv.conf
net=$(ifconfig | grep "inet 10" | awk '{print $2}' | sed -r 's/:/_/g' )!
if [ $net == "!" ]
then
echo DANGER $net $(date)
echo $(date) ON COX
echo STOPPING
ifconfig | grep inet
#service transmission-daemon stop
kill -9 $(ps -ef | grep transmission | awk '{print $2}')
echo $(date) STOPPED TRANSMISSION
else
echo safe $net $(date)
tranny=$(service transmission-daemon status | grep "transmission-daemon is running" | awk '{print $2}')!
if [ $tranny == "!" ]
then
echo Restarting transmission
echo $net Transmission start
transmission-daemon -g /etc/transmission-daemon
else
echo Transmission is Ok
fi
fi
sleep 10
echo looping $(date)
done
The settings.safe is the transmission config file with the plaintext password on the password line, so you can update it as needed.
Content type
Image
Digest
Size
94.2 MB
Last updated
about 7 years ago
docker pull mspk7305/torrentboxes:deb