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