mirror of
https://github.com/ilteoood/docker-surfshark.git
synced 2026-01-02 19:07:20 +01:00
Merge pull request #20 from iBeech/patch-1
Added support for multiple subnets to be passed to the LAN_NETWORK va…
This commit is contained in:
11
startup.sh
11
startup.sh
@@ -10,8 +10,15 @@ 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)
|
||||
ip route add "${LAN_NETWORK}" via "${DEFAULT_GATEWAY}" dev eth0
|
||||
echo Adding ip route add "${LAN_NETWORK}" via "${DEFAULT_GATEWAY}" dev eth0 for attached container web ui access
|
||||
|
||||
splitSubnets=$(echo ${LAN_NETWORK} | tr "," "\n")
|
||||
|
||||
for subnet in $splitSubnets
|
||||
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
|
||||
|
||||
echo Do not forget to expose the ports for attached container we ui access
|
||||
fi
|
||||
openvpn --config $VPN_FILE --auth-user-pass vpn-auth.txt --mute-replay-warnings $OPENVPN_OPTS
|
||||
|
||||
Reference in New Issue
Block a user