#!/bin/sh
#
# Check local databases.
#

# PROVIDE: tbdbcheck
# REQUIRE: mysql 
# BEFORE: testbed
# KEYWORD: shutdown

MAINSITE="@TBMAINSITE@"
PROTOGENI="@PROTOGENI_SUPPORT@"
DBNAME="@TBDBNAME@"
LOGFILE="/var/log/mysqlcheck.log"

case "$1" in
	start)
		rm -f $LOGFILE
		if [ $MAINSITE == "0" ]; then
		    echo "*** Checking $DBNAME ..." >> $LOGFILE
		    mysqlcheck --auto-repair $DBNAME >> $LOGFILE
		fi
		if [ $PROTOGENI != "0" ]; then
		    echo "*** Checking geni ..." >> $LOGFILE
		    mysqlcheck --auto-repair geni >> $LOGFILE
		    echo "*** Checking geni-ch ..." >> $LOGFILE
		    mysqlcheck --auto-repair geni-ch >> $LOGFILE
		    echo "*** Checking geni-cm ..." >> $LOGFILE
		    mysqlcheck --auto-repair geni-cm >> $LOGFILE
		fi
		;;
	stop)
		;;
	*)
		echo ""
		echo "Usage: `basename $0` { start | stop }"
		echo ""
		exit 64
		;;
esac
exit 0

Add boot script to check the DB tables for corruption before trying to start the testbed.
Add boot script to check the DB tables for corruption before
trying to start the testbed.
