File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66# The latest version of this script is available at:
77# https://github.com/hwdsl2/setup-ipsec-vpn
88#
9- # Copyright (C) 2021-2025 Lin Song <linsongui@gmail.com>
9+ # Copyright (C) 2021-2026 Lin Song <linsongui@gmail.com>
1010#
1111# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
1212# Unported License: http://creativecommons.org/licenses/by-sa/3.0/
Original file line number Diff line number Diff line change 55# The latest version of this script is available at:
66# https://github.com/hwdsl2/setup-ipsec-vpn
77#
8- # Copyright (C) 2021-2025 Lin Song <linsongui@gmail.com>
8+ # Copyright (C) 2021-2026 Lin Song <linsongui@gmail.com>
99#
1010# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
1111# Unported License: http://creativecommons.org/licenses/by-sa/3.0/
Original file line number Diff line number Diff line change 55# The latest version of this script is available at:
66# https://github.com/hwdsl2/setup-ipsec-vpn
77#
8- # Copyright (C) 2020-2025 Lin Song <linsongui@gmail.com>
8+ # Copyright (C) 2020-2026 Lin Song <linsongui@gmail.com>
99#
1010# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
1111# Unported License: http://creativecommons.org/licenses/by-sa/3.0/
Original file line number Diff line number Diff line change 55# The latest version of this script is available at:
66# https://github.com/hwdsl2/setup-ipsec-vpn
77#
8- # Copyright (C) 2016-2025 Lin Song <linsongui@gmail.com>
8+ # Copyright (C) 2016-2026 Lin Song <linsongui@gmail.com>
99#
1010# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
1111# Unported License: http://creativecommons.org/licenses/by-sa/3.0/
Original file line number Diff line number Diff line change 55# The latest version of this script is available at:
66# https://github.com/hwdsl2/setup-ipsec-vpn
77#
8- # Copyright (C) 2016-2025 Lin Song <linsongui@gmail.com>
8+ # Copyright (C) 2016-2026 Lin Song <linsongui@gmail.com>
99#
1010# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
1111# Unported License: http://creativecommons.org/licenses/by-sa/3.0/
Original file line number Diff line number Diff line change @@ -200,11 +200,10 @@ detect_ipv6() {
200200 fi
201201 if [ -n " $VPN_PUBLIC_IP6 " ]; then
202202 ip6=" $VPN_PUBLIC_IP6 "
203- check_ip6 " $ip6 " || exiterr " Invalid IPv6 address. Check variable 'VPN_PUBLIC_IP6'."
204- else
205- ip6_addr=$( ip -6 addr 2> /dev/null | awk ' /inet6 [23]/ {print $2}' | cut -d' /' -f1 | head -n1)
206- [ -n " $ip6_addr " ] && ip6=" $ip6_addr "
203+ check_ip6 " $ip6 " || { echo " Warning: Invalid IPv6 address in 'VPN_PUBLIC_IP6'. Detecting IPv6..." >&2 ; ip6=" " ; }
207204 fi
205+ [ -z " $ip6 " ] && ip6=$( ip -6 addr 2> /dev/null | awk ' /inet6 [23]/ {print $2}' | cut -d' /' -f1 | head -n1)
206+ check_ip6 " $ip6 " || ip6=" "
208207}
209208
210209install_vpn_pkgs () {
Original file line number Diff line number Diff line change @@ -187,11 +187,10 @@ detect_ipv6() {
187187 fi
188188 if [ -n " $VPN_PUBLIC_IP6 " ]; then
189189 ip6=" $VPN_PUBLIC_IP6 "
190- check_ip6 " $ip6 " || exiterr " Invalid IPv6 address. Check variable 'VPN_PUBLIC_IP6'."
191- else
192- ip6_addr=$( ip -6 addr 2> /dev/null | awk ' /inet6 [23]/ {print $2}' | cut -d' /' -f1 | head -n1)
193- [ -n " $ip6_addr " ] && ip6=" $ip6_addr "
190+ check_ip6 " $ip6 " || { echo " Warning: Invalid IPv6 address in 'VPN_PUBLIC_IP6'. Detecting IPv6..." >&2 ; ip6=" " ; }
194191 fi
192+ [ -z " $ip6 " ] && ip6=$( ip -6 addr 2> /dev/null | awk ' /inet6 [23]/ {print $2}' | cut -d' /' -f1 | head -n1)
193+ check_ip6 " $ip6 " || ip6=" "
195194}
196195
197196add_epel_repo () {
Original file line number Diff line number Diff line change @@ -241,11 +241,10 @@ detect_ipv6() {
241241 fi
242242 if [ -n " $VPN_PUBLIC_IP6 " ]; then
243243 ip6=" $VPN_PUBLIC_IP6 "
244- check_ip6 " $ip6 " || exiterr " Invalid IPv6 address. Check variable 'VPN_PUBLIC_IP6'."
245- else
246- ip6_addr=$( ip -6 addr 2> /dev/null | awk ' /inet6 [23]/ {print $2}' | cut -d' /' -f1 | head -n1)
247- [ -n " $ip6_addr " ] && ip6=" $ip6_addr "
244+ check_ip6 " $ip6 " || { echo " Warning: Invalid IPv6 address in 'VPN_PUBLIC_IP6'. Detecting IPv6..." >&2 ; ip6=" " ; }
248245 fi
246+ [ -z " $ip6 " ] && ip6=$( ip -6 addr 2> /dev/null | awk ' /inet6 [23]/ {print $2}' | cut -d' /' -f1 | head -n1)
247+ check_ip6 " $ip6 " || ip6=" "
249248}
250249
251250add_epel_repo () {
Original file line number Diff line number Diff line change @@ -265,11 +265,10 @@ detect_ipv6() {
265265 fi
266266 if [ -n " $VPN_PUBLIC_IP6 " ]; then
267267 ip6=" $VPN_PUBLIC_IP6 "
268- check_ip6 " $ip6 " || exiterr " Invalid IPv6 address. Check variable 'VPN_PUBLIC_IP6'."
269- else
270- ip6_addr=$( ip -6 addr 2> /dev/null | awk ' /inet6 [23]/ {print $2}' | cut -d' /' -f1 | head -n1)
271- [ -n " $ip6_addr " ] && ip6=" $ip6_addr "
268+ check_ip6 " $ip6 " || { echo " Warning: Invalid IPv6 address in 'VPN_PUBLIC_IP6'. Detecting IPv6..." >&2 ; ip6=" " ; }
272269 fi
270+ [ -z " $ip6 " ] && ip6=$( ip -6 addr 2> /dev/null | awk ' /inet6 [23]/ {print $2}' | cut -d' /' -f1 | head -n1)
271+ check_ip6 " $ip6 " || ip6=" "
273272}
274273
275274install_vpn_pkgs () {
You can’t perform that action at this time.
0 commit comments