From db0668c5116df82b1b4d9a9dd4307c4d76229121 Mon Sep 17 00:00:00 2001 From: Philipp Schmitt Date: Wed, 2 Nov 2016 13:19:46 +0100 Subject: [PATCH] Use only first IPv4 address of VIRT_NET_DEV --- pia-tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pia-tools b/pia-tools index a1b8f59..f38dc70 100755 --- a/pia-tools +++ b/pia-tools @@ -209,7 +209,7 @@ new_client_id() { request_port() { local username="$(head -1 $PIA_PASSWD_FILE)" local passwd="$(tail -1 $PIA_PASSWD_FILE)" - local local_vpn_ip="$(ip addr show $VIRT_NET_DEV | grep inet | awk '{ print $2 }')" + local local_vpn_ip="$(ip addr show $VIRT_NET_DEV | awk '/inet / { print $2; exit}')" local client_id="$1" [[ -z "$local_vpn_ip" ]] && local_vpn_ip=$LOCAL_IP echo -n "Updating port forwarding... "