projects
/
dell-switch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dd6776b
)
generate /tmp/topology.svg from descriptions
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 8 Jul 2018 11:06:32 +0000
(13:06 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 8 Jul 2018 11:06:32 +0000
(13:06 +0200)
graphiz-topology.sh
[new file with mode: 0755]
patch
|
blob
diff --git a/graphiz-topology.sh
b/graphiz-topology.sh
new file mode 100755
(executable)
index 0000000..
ecfc44a
--- /dev/null
+++ b/
graphiz-topology.sh
@@ -0,0
+1,10
@@
+#!/bin/sh -xe
+
+(
+echo "digraph topology {"
+
+egrep '\[sw-' /dev/shm/port-status/* | cut -d: -f2- | tr -d '\[' | tr -d '\]' | awk '{ printf(" \"%s\" -> \"%s\";\n", $1,$7)}'
+
+echo "}"
+) | tee /tmp/topology.dot | dot -Tsvg -o /tmp/topology.svg
+