mirror of
				https://github.com/angristan/openvpn-install.git
				synced 2025-10-31 05:57:36 +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:
		| @@ -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 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Henry N
					Henry N