mirror of
https://github.com/angristan/openvpn-install.git
synced 2024-11-22 08:49:03 +01:00
Fix getting pulic interface in IPv6 only (#578)
In a IPv6 only environment, the variable $NIC would be empty and iptables in add-openvpn-rules.sh will fail by missing argument.
This commit is contained in:
parent
6bb87ae716
commit
aab5e7b2ff
@ -606,6 +606,9 @@ function installOpenVPN () {
|
|||||||
|
|
||||||
# Get the "public" interface from the default route
|
# Get the "public" interface from the default route
|
||||||
NIC=$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)
|
NIC=$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)
|
||||||
|
if [[ -z "$NIC" ]] && [[ "$IPV6_SUPPORT" = 'y' ]]; then
|
||||||
|
NIC=$(ip -6 route show default | sed -ne 's/^default .* dev \([^ ]*\) .*$/\1/p')
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$OS" =~ (debian|ubuntu) ]]; then
|
if [[ "$OS" =~ (debian|ubuntu) ]]; then
|
||||||
apt-get update
|
apt-get update
|
||||||
|
Loading…
Reference in New Issue
Block a user