#!/bin/sh if [ "$1" = "-h" ] then echo "Command Syntax: Flags: Extract Vlan/IP Interface Table (use with IOS based Switches) = -v Extract Interface/IP table (use with IOS based routers) = -i vidump.sh generates a list of vlan or physical interfaces from a Cisco IOS based router or switch. ";exit fi if [ "$1" = "" ] then echo "No username been specfied.";exit fi if [ "$1" = "" ] then echo "No host been specfied.";exit fi if [ "$3" = "" ] then echo "No report type been specfied.";exit fi if [ "$3" = "-v" ] then ssh -l $1 $2 show ip interface br | grep "Vlan*" | awk '{print $1 "\t"$2}' > Vlan-list-$2-`date +%m-%d-%y`.txt;cat "Vlan-list-$2-`date +%m-%d-%y`.txt";echo The Report Name is: "Vlan-list-$2-`date +%m-%d-%y`.txt"; exit fi if [ "$3" = "-i" ] then ssh -l $1 $2 show ip interface br | grep -v "Vlan*" | sed '1,2d' | awk '{print $1 "\t"$2}' > Interface-list-$2-`date +%m-%d-%y`.txt; more Interface-list-$2-`date +%m-%d-%y`.txt;cat "Interface-list-$2-`date +%m-%d-%y`.txt" ;echo The Report Name is "Interface-list-$2-`date +%m-%d-%y`.txt"; exit fi