#!/usr/bin/sh

if [ $# -gt 0 ]
then
	echo "usage: $0"
	exit 1
fi

HOME=/usr/local; export HOME
SAFE=$HOME/.s; export SAFE

EMAIL=goober@xyz.com
HOST=$(hostname)

#
#  Run the safety checks
#

$SAFE/bin/safe.sh > /tmp/safe.$$ 2>&1

egrep -v "Check:|-----|$(uname -n)" /tmp/safe.$$ > /tmp/safeexp.$$

if [ -s /tmp/safeexp.$$ ]
then
	cat /tmp/safe.$$ | mailx -s "Safe - $HOST" $EMAIL
else
	echo "All is well on host $(uname -n)" 
fi

rm -f /tmp/safe.$$ /tmp/safeexp.$$