Skip to content

Instantly share code, notes, and snippets.

@PieGuy314
Created November 9, 2017 10:13
Show Gist options
  • Save PieGuy314/708d4958195bc30a4ab3e2dcc678ef4e to your computer and use it in GitHub Desktop.
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.
#!/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
@PieGuy314
Copy link
Author

No longer required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment