transmission startup handles setting.json, and possible to have transmission data-dir on mounted volume for persistent state

This commit is contained in:
Kristian Haugene 2015-05-10 20:51:19 +02:00
parent d129497ca5
commit 629e8d0fac
4 changed files with 15 additions and 9 deletions

View File

@ -20,7 +20,7 @@ RUN apt-get update \
ADD piaconfig/* /etc/openvpn/
ADD piaconfig/ca.crt /etc/openvpn/ca.crt
ADD piaconfig/crl.pem /etc/openvpn/crl.pem
ADD transmission/defaultSettings.json /etc/transmission-daemon/settings.json
ADD transmission/defaultSettings.tmpl /etc/transmission-daemon/settings.tmpl
ADD transmission/updateTransmissionPort.sh /etc/transmission-daemon/updatePort.sh
ADD transmission/periodicUpdates.sh /etc/transmission-daemon/periodicUpdates.sh
ADD transmission/run.sh /etc/transmission-daemon/start.sh

View File

@ -34,8 +34,4 @@ else
echo $PIA_PASSWORD >> /config/pia-credentials.txt
fi
dockerize \
-template /etc/transmission-daemon/settings.json:/etc/transmission-daemon/settings.json \
true
exec openvpn --config "$OPEN_VPN_CONFIG"

View File

@ -1,11 +1,21 @@
#!/bin/sh
if [ -f /config/transmission/settings.json ];
if [ ! -z "${KEEP_TRANSMISSION_STATE}" ]
then
echo "STARTING TRANSMISSION: Using custom config directory /config/transmission"
exec /usr/bin/transmission-daemon -g /config/transmission/ &
echo "STARTING TRANSMISSION: Using transmission-data subdirectory to your /data mount point to store state."
# Initialize settings from environment variables
dockerize -template /etc/transmission-daemon/settings.tmpl:/data/transmission-data/settings.json \
true
exec /usr/bin/transmission-daemon -g /data/transmission-data/ &
else
echo "STARTING TRANSMISSION: No configuration provided, using defaults"
echo "STARTING TRANSMISSION: Storing state in container only."
# Initialize settings from environment variables
dockerize -template /etc/transmission-daemon/settings.tmpl:/etc/transmission-daemon/settings.json \
true
exec /usr/bin/transmission-daemon -g /etc/transmission-daemon/ &
fi