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
|
2015-08-09 19:00:49 +00:00
|
|
|
. /etc/transmission/environment-variables.sh
|
2015-05-24 18:40:25 +00:00
|
|
|
|
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"
|
2015-08-13 04:57:47 +00:00
|
|
|
# Ensure TRANSMISSION_HOME is created
|
|
|
|
mkdir -p ${TRANSMISSION_HOME}
|
2015-08-13 16:26:21 +00:00
|
|
|
dockerize -template /etc/transmission/settings.tmpl:${TRANSMISSION_HOME}/settings.json /bin/true
|
2015-05-23 16:30:58 +00:00
|
|
|
|
2015-05-24 17:05:05 +00:00
|
|
|
echo "STARTING TRANSMISSION"
|
2015-08-13 04:57:47 +00:00
|
|
|
exec /usr/bin/transmission-daemon -g ${TRANSMISSION_HOME} &
|
2015-05-24 17:05:05 +00:00
|
|
|
|
2015-08-07 21:07:55 +00:00
|
|
|
if [ "$OPENVPN_PROVIDER" = "PIA" ]
|
|
|
|
then
|
|
|
|
echo "STARTING PORT UPDATER"
|
2015-08-09 19:00:49 +00:00
|
|
|
exec /etc/transmission/periodicUpdates.sh &
|
2015-08-07 21:07:55 +00:00
|
|
|
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."
|