Listing 3: Quiet

#	Quiet ---	check system for suid progs & command changes
#
#	method:	Execute 'Safe' and 'egrep' out the normal lines.
#		If any other lines remain, then 'mail' exception
#		report to system managers on a central machine.
#		Remove temporary files.
#--------------------------------------------------------------
if [ $# -gt 0 ]	#  should  have  NO  arguments!
then
	cat <<E_USAGE
	USAGE:     $0  2>&1  | mail tarpon!rick tarpon!newt
		       (executed by cron at 1:10am...)
E_USAGE
	exit 1
fi
#--------------------------------------------------------------
HOME=/u/wdr;	export HOME	#  keep  in  non-standard  place
SAFE=$HOME/.s;	export SAFE	#  to  fake  out  smart  intruders  :-)
$HOME/bin/Safe  >/tmp/$$  2>&1
egrep -v "Check:|------|`uname -n`" /tmp/$$ >/tmp/excp.$$
if [ -s /tmp/excp.$$ ]		#  if  size  is  non-zero
then
	cat /tmp/$$	#  send  'diff'  output
else
	echo "\nAll is well on `uname -n`."	#  no  diff!
fi
rm -f  /tmp/$$  /tmp/excp.$$
#-------------------------------------------------------THE END


