From bb70ced9d08e23bc10e457323ceba8cd75092c55 Mon Sep 17 00:00:00 2001 From: enoch85 Date: Thu, 13 Oct 2016 14:11:33 +0200 Subject: [PATCH] only fetch one iface --- static/ip.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/ip.sh b/static/ip.sh index 7d883762..604dc250 100644 --- a/static/ip.sh +++ b/static/ip.sh @@ -3,7 +3,7 @@ IFCONFIG="/sbin/ifconfig" INTERFACES="/etc/network/interfaces" -IFACE=$(lshw -c network | grep "logical name" | awk '{print $3}') +IFACE=$(lshw -c network | grep "logical name" | awk '{print $3; exit}') ADDRESS=$(hostname -I | cut -d ' ' -f 1) NETMASK=$($IFCONFIG | grep -w inet |grep -v 127.0.0.1| awk '{print $4}' | cut -d ":" -f 2) GATEWAY=$(route -n|grep "UG"|grep -v "UGH"|cut -f 10 -d " ")