aboutsummaryrefslogtreecommitdiffstats
path: root/extras/tools/lldp/dotnet.sh
diff options
context:
space:
mode:
Diffstat (limited to 'extras/tools/lldp/dotnet.sh')
-rwxr-xr-xextras/tools/lldp/dotnet.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/extras/tools/lldp/dotnet.sh b/extras/tools/lldp/dotnet.sh
index 5c1b369..40e5024 100755
--- a/extras/tools/lldp/dotnet.sh
+++ b/extras/tools/lldp/dotnet.sh
@@ -1,9 +1,8 @@
#!/usr/bin/env bash
-
-DATE="$(date +%s)"
-if [ -z "$1" ] || [ -z "$2" ]; then
- echo "Usage: $0 <ip> <community>"
- exit 1;
-fi
-./lldpdiscover.pl $1 $2 | ./draw-neighbors.pl | dot -Tpng > dotnet-${DATE}.png
-echo File name: dotnet-${DATE}.png
+set -xe
+DATE="$(date --iso-8601=second | sed s/:/./g)"
+JSON=lolwhat-${DATE}.json
+./lolwhat.pl $* > ${JSON}
+./draw-neighbors.pl < ${JSON} | dot -Tpng > lolwhat-${DATE}.png
+./draw-neighbors.pl full < ${JSON} | dot -Tpng > lolwhat-${DATE}-full.png
+echo File name: lolwhat-${DATE}*png