From 0949d82219b84066c82bf4aa7cef80112cf6aaca Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Sun, 9 Aug 2015 21:00:49 +0200 Subject: [PATCH] moved scripts and templates out of transmission daemon home folder. this allows mounting of /etc/transmission-daemon to keep state, ref issue #22 --- Dockerfile | 2 +- openvpn/btguard/btguard.ovpn | 4 ++-- openvpn/pia/AU Melbourne.ovpn | 4 ++-- openvpn/pia/AU Sydney.ovpn | 4 ++-- openvpn/pia/CA North York.ovpn | 4 ++-- openvpn/pia/CA Toronto.ovpn | 4 ++-- openvpn/pia/France.ovpn | 4 ++-- openvpn/pia/Germany.ovpn | 4 ++-- openvpn/pia/Hong Kong.ovpn | 4 ++-- openvpn/pia/Israel.ovpn | 4 ++-- openvpn/pia/Japan.ovpn | 4 ++-- openvpn/pia/Mexico.ovpn | 4 ++-- openvpn/pia/Netherlands.ovpn | 4 ++-- openvpn/pia/Romania.ovpn | 4 ++-- openvpn/pia/Russia.ovpn | 4 ++-- openvpn/pia/Singapore.ovpn | 4 ++-- openvpn/pia/Sweden.ovpn | 4 ++-- openvpn/pia/Switzerland.ovpn | 4 ++-- openvpn/pia/UK London.ovpn | 4 ++-- openvpn/pia/UK Southampton.ovpn | 4 ++-- openvpn/pia/US California.ovpn | 4 ++-- openvpn/pia/US East.ovpn | 4 ++-- openvpn/pia/US Florida.ovpn | 4 ++-- openvpn/pia/US Midwest.ovpn | 4 ++-- openvpn/pia/US Seattle.ovpn | 4 ++-- openvpn/pia/US Silicon Valley.ovpn | 4 ++-- openvpn/pia/US Texas.ovpn | 4 ++-- openvpn/pia/US West.ovpn | 4 ++-- openvpn/start.sh | 2 +- transmission/periodicUpdates.sh | 2 +- transmission/start.sh | 6 +++--- transmission/updatePort.sh | 2 +- 32 files changed, 61 insertions(+), 61 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1f339b4..c7dc019 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN apt-get update \ # Add configuration and scripts ADD openvpn/ /etc/openvpn/ -ADD transmission/ /etc/transmission-daemon/ +ADD transmission/ /etc/transmission/ ENV OPENVPN_USERNAME=**None** \ OPENVPN_PASSWORD=**None** \ diff --git a/openvpn/btguard/btguard.ovpn b/openvpn/btguard/btguard.ovpn index a6d645f..539dd54 100644 --- a/openvpn/btguard/btguard.ovpn +++ b/openvpn/btguard/btguard.ovpn @@ -17,5 +17,5 @@ auth-user-pass /config/openvpn-credentials.txt # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/AU Melbourne.ovpn b/openvpn/pia/AU Melbourne.ovpn index a6da1ee..f7ae5dd 100644 --- a/openvpn/pia/AU Melbourne.ovpn +++ b/openvpn/pia/AU Melbourne.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/AU Sydney.ovpn b/openvpn/pia/AU Sydney.ovpn index 15982e2..e322b05 100644 --- a/openvpn/pia/AU Sydney.ovpn +++ b/openvpn/pia/AU Sydney.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/CA North York.ovpn b/openvpn/pia/CA North York.ovpn index b0799e2..95c4f1d 100644 --- a/openvpn/pia/CA North York.ovpn +++ b/openvpn/pia/CA North York.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/CA Toronto.ovpn b/openvpn/pia/CA Toronto.ovpn index ecab85c..ad7542a 100644 --- a/openvpn/pia/CA Toronto.ovpn +++ b/openvpn/pia/CA Toronto.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/France.ovpn b/openvpn/pia/France.ovpn index cffcf9e..cb86432 100644 --- a/openvpn/pia/France.ovpn +++ b/openvpn/pia/France.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/Germany.ovpn b/openvpn/pia/Germany.ovpn index 57334f5..2e9b203 100644 --- a/openvpn/pia/Germany.ovpn +++ b/openvpn/pia/Germany.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/Hong Kong.ovpn b/openvpn/pia/Hong Kong.ovpn index 0ec0745..63b4c54 100644 --- a/openvpn/pia/Hong Kong.ovpn +++ b/openvpn/pia/Hong Kong.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/Israel.ovpn b/openvpn/pia/Israel.ovpn index 961d740..8d5dee1 100644 --- a/openvpn/pia/Israel.ovpn +++ b/openvpn/pia/Israel.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/Japan.ovpn b/openvpn/pia/Japan.ovpn index 8368ab2..861c1ef 100644 --- a/openvpn/pia/Japan.ovpn +++ b/openvpn/pia/Japan.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/Mexico.ovpn b/openvpn/pia/Mexico.ovpn index b589eb8..562d7ef 100644 --- a/openvpn/pia/Mexico.ovpn +++ b/openvpn/pia/Mexico.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/Netherlands.ovpn b/openvpn/pia/Netherlands.ovpn index 94e71d9..69921c3 100644 --- a/openvpn/pia/Netherlands.ovpn +++ b/openvpn/pia/Netherlands.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/Romania.ovpn b/openvpn/pia/Romania.ovpn index 49442d7..ba2ed65 100644 --- a/openvpn/pia/Romania.ovpn +++ b/openvpn/pia/Romania.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/Russia.ovpn b/openvpn/pia/Russia.ovpn index 9f74644..844412c 100644 --- a/openvpn/pia/Russia.ovpn +++ b/openvpn/pia/Russia.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/Singapore.ovpn b/openvpn/pia/Singapore.ovpn index 5d89d00..8ce8b3d 100644 --- a/openvpn/pia/Singapore.ovpn +++ b/openvpn/pia/Singapore.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/Sweden.ovpn b/openvpn/pia/Sweden.ovpn index 6fc4044..2e191d6 100644 --- a/openvpn/pia/Sweden.ovpn +++ b/openvpn/pia/Sweden.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/Switzerland.ovpn b/openvpn/pia/Switzerland.ovpn index 863521d..fd1f468 100644 --- a/openvpn/pia/Switzerland.ovpn +++ b/openvpn/pia/Switzerland.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/UK London.ovpn b/openvpn/pia/UK London.ovpn index f894dce..c562eee 100644 --- a/openvpn/pia/UK London.ovpn +++ b/openvpn/pia/UK London.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/UK Southampton.ovpn b/openvpn/pia/UK Southampton.ovpn index 417c5e1..3bc0d56 100644 --- a/openvpn/pia/UK Southampton.ovpn +++ b/openvpn/pia/UK Southampton.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/US California.ovpn b/openvpn/pia/US California.ovpn index 9698f75..5f4b83a 100644 --- a/openvpn/pia/US California.ovpn +++ b/openvpn/pia/US California.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/US East.ovpn b/openvpn/pia/US East.ovpn index 829be8e..dc001c7 100644 --- a/openvpn/pia/US East.ovpn +++ b/openvpn/pia/US East.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/US Florida.ovpn b/openvpn/pia/US Florida.ovpn index a63b848..c0ad5ae 100644 --- a/openvpn/pia/US Florida.ovpn +++ b/openvpn/pia/US Florida.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/US Midwest.ovpn b/openvpn/pia/US Midwest.ovpn index 7ec8f24..e6759c9 100644 --- a/openvpn/pia/US Midwest.ovpn +++ b/openvpn/pia/US Midwest.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/US Seattle.ovpn b/openvpn/pia/US Seattle.ovpn index 054ade8..b8dc7fb 100644 --- a/openvpn/pia/US Seattle.ovpn +++ b/openvpn/pia/US Seattle.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/US Silicon Valley.ovpn b/openvpn/pia/US Silicon Valley.ovpn index 40594dd..108b654 100644 --- a/openvpn/pia/US Silicon Valley.ovpn +++ b/openvpn/pia/US Silicon Valley.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/US Texas.ovpn b/openvpn/pia/US Texas.ovpn index 65ba1b3..7a871ae 100644 --- a/openvpn/pia/US Texas.ovpn +++ b/openvpn/pia/US Texas.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/pia/US West.ovpn b/openvpn/pia/US West.ovpn index ed2ccf0..b5cf04d 100644 --- a/openvpn/pia/US West.ovpn +++ b/openvpn/pia/US West.ovpn @@ -18,5 +18,5 @@ crl-verify /etc/openvpn/pia/crl.pem # OpenVPN control startup and shut down of transmission script-security 2 -up /etc/transmission-daemon/start.sh -down /etc/transmission-daemon/stop.sh +up /etc/transmission/start.sh +down /etc/transmission/stop.sh diff --git a/openvpn/start.sh b/openvpn/start.sh index e575c60..36bde8c 100755 --- a/openvpn/start.sh +++ b/openvpn/start.sh @@ -48,6 +48,6 @@ echo $TRANSMISSION_RPC_USERNAME > /config/transmission-credentials.txt echo $TRANSMISSION_RPC_PASSWORD >> /config/transmission-credentials.txt # Persist transmission settings for use by transmission-daemon -dockerize -template /etc/transmission-daemon/environment-variables.tmpl:/etc/transmission-daemon/environment-variables.sh /bin/true +dockerize -template /etc/transmission/environment-variables.tmpl:/etc/transmission/environment-variables.sh /bin/true exec openvpn --config "$OPENVPN_CONFIG" diff --git a/transmission/periodicUpdates.sh b/transmission/periodicUpdates.sh index 2325b27..3bc3fe9 100755 --- a/transmission/periodicUpdates.sh +++ b/transmission/periodicUpdates.sh @@ -3,6 +3,6 @@ while [ 1 ] do sleep 1m - /etc/transmission-daemon/updatePort.sh + /etc/transmission/updatePort.sh sleep 1h done diff --git a/transmission/start.sh b/transmission/start.sh index 5c21ffb..ba76902 100755 --- a/transmission/start.sh +++ b/transmission/start.sh @@ -1,14 +1,14 @@ #!/bin/sh # Source our persisted env variables from container startup -. /etc/transmission-daemon/environment-variables.sh +. /etc/transmission/environment-variables.sh 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} echo "Generating transmission settings.json from env variables" -dockerize -template /etc/transmission-daemon/settings.tmpl:/etc/transmission-daemon/settings.json /bin/true +dockerize -template /etc/transmission/settings.tmpl:/etc/transmission-daemon/settings.json /bin/true echo "STARTING TRANSMISSION" exec /usr/bin/transmission-daemon -g /etc/transmission-daemon/ & @@ -16,7 +16,7 @@ exec /usr/bin/transmission-daemon -g /etc/transmission-daemon/ & if [ "$OPENVPN_PROVIDER" = "PIA" ] then echo "STARTING PORT UPDATER" - exec /etc/transmission-daemon/periodicUpdates.sh & + exec /etc/transmission/periodicUpdates.sh & else echo "NO PORT UPDATER FOR THIS PROVIDER" fi diff --git a/transmission/updatePort.sh b/transmission/updatePort.sh index d3fc527..accae83 100755 --- a/transmission/updatePort.sh +++ b/transmission/updatePort.sh @@ -9,7 +9,7 @@ pia_passwd=$(tail -1 $PIA_PASSWD_FILE) transmission_username=$(head -1 $TRANSMISSION_PASSWD_FILE) transmission_passwd=$(tail -1 $TRANSMISSION_PASSWD_FILE) local_vpn_ip=$(ip addr show tun0 | grep inet | awk '{ print $2 }') -pia_client_id_file=/etc/transmission-daemon/pia_client_id +pia_client_id_file=/etc/transmission/pia_client_id transmission_settings_file=/etc/transmission-daemon/settings.json port_assignment_url=https://www.privateinternetaccess.com/vpninfo/port_forward_assignment