projects
/
dell-switch
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
read commands from STDIN if used as pipe
[dell-switch]
/
graphiz-topology.sh
1
#!/bin/sh -xe
2
3
(
4
echo "digraph topology {"
5
6
egrep '\[sw-' /dev/shm/port-status/* | cut -d: -f2- | tr -d '\[' | tr -d '\]' | awk '{ printf(" \"%s\" -> \"%s\";\n", $1,$7)}'
7
8
echo "}"
9
) | tee /tmp/topology.dot | dot -Tsvg -o /tmp/topology.svg
10