Skip to content

Commit d207e04

Browse files
author
Daniel Hansson
authored
Update ip.sh
1 parent 7d0d7eb commit d207e04

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

static/ip.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/bin/sh
22

3-
# This file is only used if IFACE fail in the startup-script
4-
53
IFCONFIG="/sbin/ifconfig"
64
INTERFACES="/etc/network/interfaces"
75

8-
IFACE=$(ip -o link show | awk '{print $2,$9}' | grep 'UP' | cut -d ':' -f 1)
6+
IFACE=$(lshw -c network | grep "logical name" | awk '{print $3; exit}')
97
ADDRESS=$(hostname -I | cut -d ' ' -f 1)
108
NETMASK=$($IFCONFIG | grep -w inet |grep -v 127.0.0.1| awk '{print $4}' | cut -d ":" -f 2)
119
GATEWAY=$(route -n|grep "UG"|grep -v "UGH"|cut -f 10 -d " ")

0 commit comments

Comments
 (0)