#!/bin/sh
# mods made by abbott@ms.uky.edu
# customized for CMS by harlan@cms-stl.com

PATH=/usr/local/bin:/usr/local/etc:/usr/etc:/etc:$PATH; export PATH

relmod /etc/sat/db/RemoteRun -pull

find /usr/spool/pulllock -type f -mtime +1 -exec rm -f {} \;

cd /usr/local/etc/sat/db

for r in [A-Z]*
do
	relmod $r -pull
done

sleep 600

for r in [A-Z]*
do
	cd /usr/local/etc/sat/db/$r
#	if [ -f ./report -a -f ./data ]; then
#		./report
#	fi
	if [ `whathost .` = `hostname` ]; then
		if [ -f report.sal -a ! -f report ]; then
			echo "no report in `pwd`"
		fi
		if [ -f check.sal -a ! -f check ]; then
			echo "no check in `pwd`"
		fi
		if [ -f prog.sal -a ! -f prog ]; then
			echo "no prog in `pwd`"
		fi
		if [ -f prog.c -a ! -f prog ]; then
			echo "no prog in `pwd`"
		fi
		if [ ! -f scheme ]; then
			echo "no scheme in `pwd`"
		fi
	fi
done

exit 0
