2014-11-11 21:07:13 +00:00
|
|
|
#!/bin/sh
|
2014-11-16 13:19:56 +00:00
|
|
|
|
2015-05-24 18:40:25 +00:00
|
|
|
# Source our persisted env variables from container startup
|
|
|
|
. /etc/transmission-daemon/environment-variables.sh
|
|
|
|
|
2015-05-24 17:05:05 +00:00
|
|
|
tun0ip=$(ifconfig tun0 | sed -n '2 p' | awk '{print $2}' | cut -d: -f2)
|
|
|
|
echo "Updating TRANSMISSION_BIND_ADDRESS_IPV4 to tun0 ip: ${tun0ip}"
|
|
|
|
export TRANSMISSION_BIND_ADDRESS_IPV4=${tun0ip}
|
2015-05-07 19:34:34 +00:00
|
|
|
|
2015-05-24 17:05:05 +00:00
|
|
|
echo "Generating transmission settings.json from env variables"
|
|
|
|
dockerize -template /etc/transmission-daemon/settings.tmpl:/etc/transmission-daemon/settings.json /bin/true
|
2015-05-23 16:30:58 +00:00
|
|
|
|
2015-05-24 17:05:05 +00:00
|
|
|
echo "STARTING TRANSMISSION"
|
|
|
|
exec /usr/bin/transmission-daemon -g /etc/transmission-daemon/ &
|
|
|
|
|
2015-08-07 21:07:55 +00:00
|
|
|
if [ "$OPENVPN_PROVIDER" = "PIA" ]
|
|
|
|
then
|
|
|
|
echo "STARTING PORT UPDATER"
|
|
|
|
exec /etc/transmission-daemon/periodicUpdates.sh &
|
|
|
|
else
|
|
|
|
echo "NO PORT UPDATER FOR THIS PROVIDER"
|
|
|
|
fi
|
2015-05-07 19:34:34 +00:00
|
|
|
|
2015-05-24 17:05:05 +00:00
|
|
|
echo "Transmission startup script complete."
|