aboutsummarylogtreecommitdiffstats
path: root/ip-pre-up.sh
diff options
context:
space:
mode:
authorBian Jiaping2017-04-29 17:30:23 +0800
committerBian Jiaping2017-04-29 17:30:23 +0800
commitf392909a2d3e1bf2df22e659a87462e89f0aeeb6 (patch)
tree07e01d658b34bb0ca697289c877c61148c02742f /ip-pre-up.sh
downloadaur-china-ip-skip-vpn.tar.gz
Initialize
Diffstat (limited to 'ip-pre-up.sh')
-rwxr-xr-xip-pre-up.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/ip-pre-up.sh b/ip-pre-up.sh
new file mode 100755
index 000000000000..4f632e56c069
--- /dev/null
+++ b/ip-pre-up.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/bash
+
+OLD_GATEWAY=`ip route show | grep '^default' | sed -e 's/default via \([^ ]*\).*/\1/'`
+
+if [[ -n $OLD_GATEWAY ]]; then
+ echo $OLD_GATEWAY > /run/vpn-old-gateway
+ chmod 644 /run/vpn-old-gateway
+fi