#!/bin/sh

#
# bbrun
#
# Sean MacGuire
# Version 1.4
# Mar 05th, 2000
#
# This program is Copyright (c) 1997-2000
# The MacLawran Group Inc.
# All Rights Reserved
#
# Execute BB shell scripts
# loop them forever
#

if test ! -x "$1"
then
	echo "Can't execute $1, exiting"
	exit 1
fi

if test "$BBSLEEP" = ""
then
	echo "BBSLEEP not set, exiting"
	exit 2
fi

# Save the pid of this bbrun for runbb.sh stop processing
echo "$$" >> $BBTMP/BBPID

while true
do
	$1
	sleep $BBSLEEP
done
