projects
/
dell-switch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fix hostname extraction
[dell-switch]
/
mac4ip.sh
diff --git
a/mac4ip.sh
b/mac4ip.sh
index
bff38a5
..
ec3c98f
100755
(executable)
--- a/
mac4ip.sh
+++ b/
mac4ip.sh
@@
-1,6
+1,6
@@
#!/bin/sh -e
-
ip
=$1
+
name
=$1
-ping -c 1 $ip >&2 && \
+ip=$( ping -c 1 $name | grep '^PING' | cut -d' ' -f3 )
/usr/sbin/arp -an | grep "\($ip\)" | awk '{ print $4 }'