mirror of
https://github.com/haugene/docker-transmission-openvpn.git
synced 2025-08-15 10:47:08 +02:00
Removing references to tun/tap device name, read from provided parameters
This commit is contained in:
parent
cdad6c9131
commit
f1547dfcbe
@ -1,8 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
LOCAL_VPN_IP=$1
|
||||||
|
|
||||||
while [ 1 ]
|
while [ 1 ]
|
||||||
do
|
do
|
||||||
sleep 1m
|
sleep 1m
|
||||||
/etc/transmission/updatePort.sh
|
/etc/transmission/updatePort.sh $LOCAL_VPN_IP
|
||||||
sleep 1h
|
sleep 1h
|
||||||
done
|
done
|
||||||
|
@ -3,9 +3,10 @@
|
|||||||
# Source our persisted env variables from container startup
|
# Source our persisted env variables from container startup
|
||||||
. /etc/transmission/environment-variables.sh
|
. /etc/transmission/environment-variables.sh
|
||||||
|
|
||||||
tun0ip=$4
|
# This script will be called with tun/tap device name as parameter 1, and local IP as parameter 4
|
||||||
echo "Updating TRANSMISSION_BIND_ADDRESS_IPV4 to tun0 ip: ${tun0ip}"
|
# See https://openvpn.net/index.php/open-source/documentation/manuals/65-openvpn-20x-manpage.html (--up cmd)
|
||||||
export TRANSMISSION_BIND_ADDRESS_IPV4=${tun0ip}
|
echo "Updating TRANSMISSION_BIND_ADDRESS_IPV4 to the ip of $1 : $4"
|
||||||
|
export TRANSMISSION_BIND_ADDRESS_IPV4=$4
|
||||||
|
|
||||||
echo "Generating transmission settings.json from env variables"
|
echo "Generating transmission settings.json from env variables"
|
||||||
# Ensure TRANSMISSION_HOME is created
|
# Ensure TRANSMISSION_HOME is created
|
||||||
@ -24,7 +25,7 @@ exec /usr/bin/transmission-daemon -g ${TRANSMISSION_HOME} --logfile ${TRANSMISSI
|
|||||||
if [ "$OPENVPN_PROVIDER" = "PIA" ]
|
if [ "$OPENVPN_PROVIDER" = "PIA" ]
|
||||||
then
|
then
|
||||||
echo "STARTING PORT UPDATER"
|
echo "STARTING PORT UPDATER"
|
||||||
exec /etc/transmission/periodicUpdates.sh &
|
exec /etc/transmission/periodicUpdates.sh $4 &
|
||||||
else
|
else
|
||||||
echo "NO PORT UPDATER FOR THIS PROVIDER"
|
echo "NO PORT UPDATER FOR THIS PROVIDER"
|
||||||
fi
|
fi
|
||||||
|
@ -11,7 +11,7 @@ pia_username=$(head -1 $PIA_PASSWD_FILE)
|
|||||||
pia_passwd=$(tail -1 $PIA_PASSWD_FILE)
|
pia_passwd=$(tail -1 $PIA_PASSWD_FILE)
|
||||||
transmission_username=$(head -1 $TRANSMISSION_PASSWD_FILE)
|
transmission_username=$(head -1 $TRANSMISSION_PASSWD_FILE)
|
||||||
transmission_passwd=$(tail -1 $TRANSMISSION_PASSWD_FILE)
|
transmission_passwd=$(tail -1 $TRANSMISSION_PASSWD_FILE)
|
||||||
local_vpn_ip=$(ip addr show tun0 | grep inet | awk '{ print $2 }')
|
local_vpn_ip=$1 # Passed as parameter from periodicUpdates.sh
|
||||||
pia_client_id_file=/etc/transmission/pia_client_id
|
pia_client_id_file=/etc/transmission/pia_client_id
|
||||||
transmission_settings_file=${TRANSMISSION_HOME}/settings.json
|
transmission_settings_file=${TRANSMISSION_HOME}/settings.json
|
||||||
port_assignment_url=https://www.privateinternetaccess.com/vpninfo/port_forward_assignment
|
port_assignment_url=https://www.privateinternetaccess.com/vpninfo/port_forward_assignment
|
||||||
|
Loading…
Reference in New Issue
Block a user