aboutsummarylogtreecommitdiffstats
path: root/ip-pre-up.sh
diff options
context:
space:
mode:
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