Created
November 9, 2017 10:13
-
-
Save PieGuy314/708d4958195bc30a4ab3e2dcc678ef4e to your computer and use it in GitHub Desktop.
Transmission: bind-address.sh - Listen for IPv4 BitTorrent connections on a specific address.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Called by /etc/openvpn/route-up.sh | |
# | |
TMPFILE=$(mktemp) | |
awk -F\" -v IP_ADDR="$ifconfig_local" '{if ($2 == "bind-address-ipv4") print $1 "\"" $2 "\"" $3 "\"" IP_ADDR "\"" $5; else print $0}' < /etc/transmission-daemon/settings.json > $TMPFILE | |
cp -pf /etc/transmission-daemon/settings.json /etc/transmission-daemon/settings.json.old | |
cat $TMPFILE > /etc/transmission-daemon/settings.json | |
rm $TMPFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No longer required.