#!/bin/ksh # $Id: compareinterface,v 1.2 2007/08/16 14:55:10 ksb Exp $ # Take a list of hosts to compare interface.cl lines with netlint (petef, ksb) # reports, output a spiff (diff with line features) of the open issues. . /usr/local/lib/distrib/local.defs : ${NETLINT_DIR=/var/netlint} export PATH=$PATH:/home/sac1/netlint/bin export NETLINT_DIR TMP=/tmp/interface.cl.$((RANDOM%1000)).$$ while [ -d "$TMP" ]; do TMP=$TMP".$$" done set -e install -d -m 700 $TMP cd $TMP rsync peg.sac::rrd/lib/interface.cl . awk -F: '{print $1":"$2":"$3":"$4":"}' interface.cl | install - interface.cl [ $# -eq 0 ] && { set _ `/bin/ls $NETLINT_DIR` shift } for host do mkinterface $host | grep -v ":tr0:" | sort >> netlint.ck grep "^${host%%.*}:" interface.cl | grep -v ":tr0:" | sort >> interface.ck done spiff -a -c netlint.ck interface.ck cd / rm -r $TMP exit 0