From a639e0d140ba700f61b1f17b11ae8feaba9b5eec Mon Sep 17 00:00:00 2001 From: iBeech Date: Fri, 15 Jan 2021 17:29:41 +0000 Subject: [PATCH] Update startup.sh --- startup.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/startup.sh b/startup.sh index 4bf7095..e7743c7 100644 --- a/startup.sh +++ b/startup.sh @@ -9,13 +9,12 @@ printf "${SURFSHARK_USER}\n${SURFSHARK_PASSWORD}" > vpn-auth.txt if [ -n ${LAN_NETWORK} ] then + DEFAULT_GATEWAY=$(ip -4 route list 0/0 | cut -d ' ' -f 3) + splitSubnets=$(echo ${LAN_NETWORK} | tr "," "\n") for subnet in $splitSubnets - do - echo "[$subnet]" - - DEFAULT_GATEWAY=$(ip -4 route list 0/0 | cut -d ' ' -f 3) + do ip route add "$subnet" via "${DEFAULT_GATEWAY}" dev eth0 echo Adding ip route add "$subnet" via "${DEFAULT_GATEWAY}" dev eth0 for attached container web ui access done