Skip to content

Commit

Permalink
do not search dmesg for network devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Lange committed Jun 6, 2016
1 parent cc1e417 commit 57ff9a9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/get-boot-info
Expand Up @@ -39,10 +39,7 @@ netdevice_info() {
# if not defined, use boot messages to determine network devices
[ -n "$netdevices" ] || netdevices=$netdevices_up

# some network driver do not echo eth0,..; they are not detected
netdevices_all=$(dmesg| perl -ne 'print $&,"\n" if m/\beth[0-9]+\b/')
tmp=$(ip link | grep "^[1-9]" | cut -d : -f 2 | cut -d ' ' -f 2 | egrep "^eth|^en")
netdevices_all="$netdevices_all $tmp"
netdevices_all=$(ip link | grep "^[1-9]" | cut -d : -f 2 | cut -d ' ' -f 2 | egrep "^eth|^en")
netdevices_all=$(for dev in $netdevices_all; do echo $dev; done| sort | uniq| tr '\n' ' ')
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down

0 comments on commit 57ff9a9

Please sign in to comment.