From a3d652755c7dfb316fffc55ec301aace30e7681d Mon Sep 17 00:00:00 2001 From: DerDanilo Date: Mon, 15 Mar 2021 18:33:47 +0100 Subject: [PATCH] support ALLOWED_IPS from setupVARs.conf --- auto_install/install.sh | 9 ++++++--- examples/unattended_wireguard_example.conf | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index f432098..34850a6 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -1093,9 +1093,12 @@ installPiVPN(){ pivpnNET="10.6.0.0" fi vpnGw="${pivpnNET/.0.0/.0.1}" - # Forward all traffic through PiVPN (i.e. full-tunnel), may be modified by - # the user after the installation. - ALLOWED_IPS="0.0.0.0/0, ::0/0" + # 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 + # the user after the installation. + ALLOWED_IPS="0.0.0.0/0, ::0/0" + fi CUSTOMIZE=0 installWireGuard diff --git a/examples/unattended_wireguard_example.conf b/examples/unattended_wireguard_example.conf index 33e6a32..2fb67a8 100644 --- a/examples/unattended_wireguard_example.conf +++ b/examples/unattended_wireguard_example.conf @@ -3,6 +3,7 @@ install_user=pi VPN=wireguard pivpnNET=10.6.0.0 subnetClass=24 +ALLOWED_IPS="0.0.0.0/0, ::0/0" pivpnPORT=51820 pivpnDNS1=9.9.9.9 pivpnDNS2=149.112.112.112