#!/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin export PATH # configuration dir=/var/local/security sum=sha1sum oldlist=oldlist.$$ newlist=newlist.$$ if [ $# -lt 1 ] then echo "usage: $0 old_date [new_date]" exit 1 fi cd $dir if [ -f "fp.$1" -o -f "fp.$1.gz" ] then echo "$sum of fp.$1 (before compression):" gzip -cdfq "fp.$1" | $sum echo echo "Files that have changed contents since footprint run of $1:" gzip -cdfq "fp.$1" | ($sum -c - 2>&1) | grep -v ': OK$' fi if [ -f "fl.$1" -o -f "fl.$1.gz" ] then echo echo "$sum of fl.$1 (before compression):" gzip -cdfq "fl.$1" | $sum echo # comparefiles is set to 1 if we are comparing two existing filelists # rather than comparing an old filelist with the current filesystem comparefiles=0 if [ -n "$2" -a \( -f "fl.$2" -o -f "fl.$2.gz" \) ] then comparefiles=1 echo "$sum of fl.$2 (before compression):" gzip -cdfq "fl.$2" | $sum echo fi # get list of filenames from first filelist file gzip -cdfq "fl.$1" | sort +17 >$oldlist if [ $comparefiles = 1 ] then # extract filenames from second filelist file gzip -cdfq "fl.$2" else # run filelist for current list filelist fi | sort +17 >$newlist if [ $comparefiles = 1 ] then echo "Filesystem differences between $1 ('<') and $2 ('>'):" else echo "Filesystem differences between $1 ('<') and now ('>'):" fi echo " inum blocks ln mode user group bytes ctime mtime name (-> symlink)" echo " ------- ------- -- ---- -------- -------- ---------- ------------------------ ------------------------ -----------------" diff $oldlist $newlist | grep '^[<>]' rm $oldlist $newlist fi