#!/bin/ksh ########################################################################## # Shell File: NetworkInterfaceInfo # # Programmer: Raymond M. A. Erdey # # Date: April 30, 1996 # # Purpose: This script will list information about the Network # # Interfaces defined on the current system. # # Command Line: NetworkInterfaceInfo # ########################################################################## #################################### # Get full path for executables. # #################################### if [ -x /usr/bin/cut ] then typeset -rs CUT="/usr/bin/cut" else typeset -rs CUT="cut" fi if [ -x /usr/bin/date ] then typeset -rs DATE="/usr/bin/date" else typeset -rs DATE="date" fi if [ -x /usr/bin/entstat ] then typeset -rs ENTSTAT="/usr/bin/entstat" else typeset -rs ENTSTAT="entstat" fi if [ -x /usr/bin/grep ] then typeset -rs GREP="/usr/bin/grep" else typeset -rs GREP="grep" fi if [ -x /bin/hostname ] then typeset -rs HOSTNAME="/bin/hostname" else typeset -rs HOSTNAME="hostname" fi if [ -x /usr/sbin/ifconfig ] then typeset -rs IFCONFIG="/usr/sbin/ifconfig" else typeset -rs IFCONFIG="ifconfig" fi if [ -x /usr/sbin/lsattr ] then typeset -rs LSATTR="/usr/sbin/lsattr" else typeset -rs LSATTR="lsattr" fi if [ -x /usr/sbin/lscfg ] then typeset -rs LSCFG="/usr/sbin/lscfg" else typeset -rs LSCFG="lscfg" fi if [ -x /usr/sbin/lsdev ] then typeset -rs LSDEV="/usr/sbin/lsdev" else typeset -rs LSDEV="lsdev" fi if [ -x /usr/sbin/netstat ] then typeset -rs NETSTAT="/usr/sbin/netstat" else typeset -rs NETSTAT="netstat" fi if [ -x /usr/sbin/no ] then typeset -rs NO="/usr/sbin/no" else typeset -rs NO="no" fi print "" print "Network Interface information for "$( ${HOSTNAME} )": "$( ${DATE} ) print "" set -x ${NETSTAT} -r set +x print "\n" set -x ${NETSTAT} -i set +x print "\n" set -x #${LSCFG} | ${GREP} -i -E "tok|ent|eth|css" ${LSDEV} -C -c adapter | ${GREP} -i -E "tok|ent|eth|css" set +x #set -A NICs $( ${LSCFG} | ${GREP} -i -E "tok|ent|eth|css" | ${CUT} -f2 -d' ' ) set -A NICs $( lsdev -C -c adapter | ${GREP} -i -E "tok|ent|eth|css" | ${CUT} -f1 -d' ' ) NumNICs=${#NICs[*]} i=0 while [ $i -lt $NumNICs ] do print "\n" set -x ${LSCFG} -l ${NICs[$i]} -v set +x print "" set -x ${LSATTR} -El ${NICs[$i]} set +x let i=i+1 done #set -A INTER $( ${LSDEV} -C | ${GREP} -i interface | ${GREP} -i -E "tr|en" | ${CUT} -f1 -d' ' ) set -A INTER $( ${LSDEV} -C -c if | ${GREP} -v -E "lo0|Defined" | ${CUT} -f1 -d' ' ) NumINTER=${#INTER[*]} i=0 while [ $i -lt $NumINTER ] do print "\n\n" set -x ${LSATTR} -El ${INTER[$i]} set +x print "" set -x ${IFCONFIG} ${INTER[$i]} set +x print "" set -x ${ENTSTAT} ${INTER[$i]} set +x let i=i+1 done print "" set -x ${NO} -a set +x