projects
/
dell-switch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c74cbe8
)
generate mac addresses from snmpbulkwalk
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 4 Apr 2022 16:53:34 +0000
(18:53 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 4 Apr 2022 16:53:34 +0000
(18:53 +0200)
sw-name-mac.sh
[new file with mode: 0755]
patch
|
blob
diff --git a/sw-name-mac.sh
b/sw-name-mac.sh
new file mode 100755
(executable)
index 0000000..
78ba48c
--- /dev/null
+++ b/
sw-name-mac.sh
@@ -0,0
+1,9
@@
+#!/bin/sh -e
+
+# we need to expand all values to two digits
+grep IF-MIB::ifPhysAddress snmpbulkwalk/* | sed -e 's/\// /' -e 's/:/ /' | cut -d' ' -f2,6 | sort -u | sed -e 's/ 0:/ 00:/' \
+-e 's/:\([0-9a-f]\):/:0\1:/gi' \
+-e 's/:\([0-9a-f]\):/:0\1:/gi' \
+-e 's/:\([0-9a-f]\):/:0\1:/gi' \
+-e 's/:\([0-9a-f]\):/:0\1:/gi' \
+-e 's/:\([0-9a-f]\)$/:0\1/i' | tee /dev/shm/sw-name-mac