only fetch one iface

This commit is contained in:
enoch85 2016-10-13 14:11:33 +02:00
parent cab8c27450
commit bb70ced9d0

View File

@ -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 " ")