mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
init: transmission
This commit is contained in:
parent
3a56b30a91
commit
1e7f25c979
13 changed files with 971 additions and 26 deletions
14
scripts/server1/routing.sh.bak
Normal file
14
scripts/server1/routing.sh.bak
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#! /usr/bin/env bash
|
||||
VPNIF="tun0"
|
||||
VPNUSER="vpn"
|
||||
GATEWAYIP=$(ifconfig $VPNIF | egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' | egrep -v '255|(127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})' | tail -n1)
|
||||
if [[ `ip rule list | grep -c 0x1` == 0 ]]; then
|
||||
ip rule add from all fwmark 0x1 lookup $VPNUSER
|
||||
fi
|
||||
ip route replace default via $GATEWAYIP table $VPNUSER
|
||||
ip route append default via 127.0.0.1 dev lo table $VPNUSER
|
||||
ip route flush cache
|
||||
|
||||
bash /etc/openvpn/update-resolv-conf
|
||||
|
||||
exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue