summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@io.vyatta.com>2008-10-01 11:44:33 -0700
committerStig Thormodsrud <stig@io.vyatta.com>2008-10-01 11:44:33 -0700
commitd52e090a6a08b5cc1814174e0863536bd4090672 (patch)
treeed1ae1522e466128fb8bfdfc1dc441d0983c2123
parent9d0f80182a2aa3a0d9eb91d3902b5b09e0c68657 (diff)
downloadvyatta-op-d52e090a6a08b5cc1814174e0863536bd4090672.tar.gz
vyatta-op-d52e090a6a08b5cc1814174e0863536bd4090672.zip
Fix 2881: "show tech-support" should limit the output of "show ip route"
-rwxr-xr-xfunctions/tech-support35
1 files changed, 33 insertions, 2 deletions
diff --git a/functions/tech-support b/functions/tech-support
index 6974392..ffd01ff 100755
--- a/functions/tech-support
+++ b/functions/tech-support
@@ -161,8 +161,39 @@ sudo /sbin/iptables -t mangle -L -vn
header \''iptables -t raw -L -vn'\'
sudo /sbin/iptables -t raw -L -vn
-header \''show ip route'\'
-show ip route
+function show_route_limit ()
+{
+ NUM=$(show $1 route $2 | wc -l)
+ # subtract 3 lines of header
+ [ $NUM -gt 3 ] && NUM=$[$NUM - 3]
+ OUTPUT=$(echo show $1 route $2 \(total $NUM\))
+ CMD="show $1 route $2"
+ if [ $3 -eq 0 ]
+ then
+ header $OUTPUT
+ vtysh -c "$CMD"
+ else
+ header "$OUTPUT- limit $3"
+ vtysh -c "$CMD" | head -n $3
+ fi
+}
+
+#
+# show all connected/static, limit the output others and include a total
+#
+show_route_limit ip connected 0
+show_route_limit ip static 0
+show_route_limit ip rip 500
+show_route_limit ip ospf 500
+show_route_limit ip bgp 500
+show_route_limit ip '' 500
+
+show_route_limit ipv6 connected 0
+show_route_limit ipv6 static 0
+show_route_limit ipv6 ripng 500
+show_route_limit ipv6 ospf6 500
+show_route_limit ipv6 bgp 500
+show_route_limit ipv6 '' 500
header $HOME/.bash_history
cat $HOME/.bash_history