repo.or.cz
/
cmdllinux.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
cleanup
[cmdllinux.git]
/
scripts
/
_first_nic.sh
blob
a912bb1e58bdc6194db93e5a7dc1a16bc347f89b
1
NIC
=
`ip addr | grep "^[0-9]\+:" | grep -v "^[0-9]\+: lo:" | grep " state UP " | head -n 1 | cut -d ' ' -f 2 | tr -d :`
2
if
[ !
-z
"
$NIC
"
];
then
3
ip addr show
$NIC
4
fi