mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
Fix vpnGW variable creation when pivpnNET was 10.X.0.0 or 10.0.0.0
Bash built-in substitution doesn't work in those cases, example: $ pivpnNET=10.34.0.0 $ vpnGw="${pivpnNET/.0/.1}" $ echo $vpnGw 10.34.1.0
This commit is contained in:
parent
85b3e82274
commit
ba2527d67b
1 changed files with 2 additions and 2 deletions
|
@ -1122,7 +1122,7 @@ setOpenVPNDefaultVars(){
|
|||
if [ -z "$pivpnNET" ]; then
|
||||
pivpnNET="$(generateRandomSubnet)"
|
||||
fi
|
||||
vpnGw="${pivpnNET/.0/.1}"
|
||||
vpnGw="$(cut -d '.' -f 1-3 <<< "${pivpnNET}").1"
|
||||
}
|
||||
|
||||
setWireguardDefaultVars(){
|
||||
|
@ -1134,7 +1134,7 @@ setWireguardDefaultVars(){
|
|||
if [ -z "$pivpnNET" ]; then
|
||||
pivpnNET="$(generateRandomSubnet)"
|
||||
fi
|
||||
vpnGw="${pivpnNET/.0/.1}"
|
||||
vpnGw="$(cut -d '.' -f 1-3 <<< "${pivpnNET}").1"
|
||||
# Allow custom allowed IPs via unattend setupVARs file. Use default if not provided.
|
||||
if [ -z "$ALLOWED_IPS" ]; then
|
||||
# Forward all traffic through PiVPN (i.e. full-tunnel), may be modified by
|
||||
|
|
Loading…
Reference in a new issue