Find IP of tun0 during transmission start up and set the configuration to bind to it. Closes #11

This commit is contained in:
Ian Neubert
2015-05-23 09:30:58 -07:00
parent 01cec65568
commit ceab19795b
4 changed files with 9 additions and 5 deletions

View File

@@ -9,6 +9,11 @@ else
exec /usr/bin/transmission-daemon -g /etc/transmission-daemon/ &
fi
# determine IP of tun0, and bind to it
export TRANSMISSION_BIND_ADDRESS_IPV4=$(ifconfig tun0 | sed -n '2 p' | awk '{print $2}' | cut -d: -f2)
echo "BINDING TRANSMISSION to $TRANSMISSION_BIND_ADDRESS_IPV4"
perl -p -i -e 's/!!BINDIPV4!!/$ENV{"TRANSMISSION_BIND_ADDRESS_IPV4"}/' /etc/transmission-daemon/settings.json
exec /etc/transmission-daemon/startPortUpdates.sh &
echo "STARTED PORT UPDATER"