From e7926148ed074ae08a55c222ef42f924439cd9f4 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Wed, 13 Jan 2016 10:33:12 -0800 Subject: [PATCH] Use pre-defined variables for desired interface --- automated install/basic-install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index b80180cb..690c50a8 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -89,9 +89,10 @@ chooseInterfaceCmd=(whiptail --separate-output --radiolist "Choose An Interface" chooseInterfaceOptions=$("${chooseInterfaceCmd[@]}" "${interfacesArray[@]}" 2>&1 >/dev/tty) for desiredInterface in $chooseInterfaceOptions do - piholeInterface=$desiredInterface - echo "Using interface: $piholeInterface" - echo ${piholeInterface} > /tmp/piholeINT + IPv4dev=$desiredInterface + IPv4addr=$(ip -o -f inet addr show dev $IPv4dev | awk '{print $4}' | awk 'END {print}') + echo "Using interface: $IPv4dev" + echo ${IPv4dev} > /tmp/piholeINT done }