From 203d7a4638d9449487e53369331fc103c892c339 Mon Sep 17 00:00:00 2001 From: Chris Long Date: Sat, 18 Apr 2020 22:53:35 -0700 Subject: [PATCH] Fixing eth1 ip detection logic Interfaces can have multiple IP addresses, causing this step to fail in Virtualbox --- Vagrant/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrant/bootstrap.sh b/Vagrant/bootstrap.sh index d634b00..bd98ccb 100644 --- a/Vagrant/bootstrap.sh +++ b/Vagrant/bootstrap.sh @@ -88,7 +88,7 @@ fix_eth1_static_ip() { }' >>/etc/dhcp/dhclient.conf netplan apply # Fix eth1 if the IP isn't set correctly - ETH1_IP=$(ip -4 addr show eth1 | grep -oP '(?<=inet\s)\d+(\.\d+){3}') + ETH1_IP=$(ip -4 addr show eth1 | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -1) if [ "$ETH1_IP" != "192.168.38.105" ]; then echo "Incorrect IP Address settings detected. Attempting to fix." ifdown eth1