mirror of
https://github.com/haugene/docker-transmission-openvpn.git
synced 2025-08-21 06:21:14 +02:00
Merge pull request #394 from T4cC0re/dev
add option to drop the default route on providers, that do not override it properly
This commit is contained in:
commit
291d3b9fa6
@ -384,3 +384,12 @@ $ sudo systemctl stop transmission-openvpn.service
|
||||
# Later ...
|
||||
$ sudo systemctl start transmission-openvpn.service
|
||||
```
|
||||
|
||||
## Drop the default route
|
||||
|
||||
Some VPNs do not override the default route, but rather set other routes with a lower metric.
|
||||
This might lead to te default route (your untunneled connection) to be used.
|
||||
|
||||
To drop the default route set the environment variable `DROP_DEFAULT_ROUTE` to `true`.
|
||||
|
||||
*Note*: This is not compatible with all VPNs. Please check yourself if your provider overrides the default route properly.
|
||||
|
@ -83,3 +83,6 @@ export PGID={{ .Env.PGID }}
|
||||
|
||||
# Support custom web frontend
|
||||
{{ if .Env.TRANSMISSION_WEB_HOME }} export TRANSMISSION_WEB_HOME={{ .Env.TRANSMISSION_WEB_HOME }} {{end}}
|
||||
|
||||
# Support dropping the default route after connection
|
||||
export DROP_DEFAULT_ROUTE={{ .Env.DROP_DEFAULT_ROUTE }}
|
||||
|
@ -50,6 +50,11 @@ fi
|
||||
|
||||
. /etc/transmission/userSetup.sh
|
||||
|
||||
if [ "true" = "$DROP_DEFAULT_ROUTE" ]; then
|
||||
echo "DROPPING DEFAULT ROUTE"
|
||||
ip r del default || exit 1
|
||||
fi
|
||||
|
||||
echo "STARTING TRANSMISSION"
|
||||
exec su --preserve-environment ${RUN_AS} -s /bin/bash -c "/usr/bin/transmission-daemon -g ${TRANSMISSION_HOME} --logfile ${TRANSMISSION_HOME}/transmission.log" &
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user