Improve workaround

- Improve workaround for non-eth0 network interfaces
- Fixed an issue where it cannot be used with sudo
This commit is contained in:
hwdsl2 2016-11-28 13:11:57 -06:00
parent af1af539aa
commit 6479212c45
2 changed files with 10 additions and 6 deletions

View File

@ -70,10 +70,12 @@ cat 1>&2 <<'EOF'
DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC!
If running on a server, you may fix this error by first
setting this variable and re-run the script:
If running on a server, try this workaround:
export VPN_IFACE="$(route | grep '^default' | grep -o '[^ ]*$')"
VPN_IFACE="$(route | grep '^default' | grep -o '[^ ]*$')"
EOF
cat 1>&2 <<EOF
sudo VPN_IFACE="\$VPN_IFACE" sh "$0"
EOF
exit 1
fi

View File

@ -69,10 +69,12 @@ cat 1>&2 <<'EOF'
DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC!
If running on a server, you may fix this error by first
setting this variable and re-run the script:
If running on a server, try this workaround:
export VPN_IFACE="$(route | grep '^default' | grep -o '[^ ]*$')"
VPN_IFACE="$(route | grep '^default' | grep -o '[^ ]*$')"
EOF
cat 1>&2 <<EOF
sudo VPN_IFACE="\$VPN_IFACE" sh "$0"
EOF
exit 1
fi