#!/bin/ksh
#
# Component: checkintegrity
#
# Description:
#      Control script of checkintegrity component
#
# Last Updated     : $Author$
# Update Date Time : $Date$
# RCS File Name    : $RCSfile$
# RCS Revision     : $Revision$
# Locked by        : $Locker$
# Symbolic name    : $Name$
# State            : $State$
#

#--- INIT ------------------------------
#needs $HOME
. $HOME/etc/ctrl.main.shi

[ -f $HOME/etc/setenv.sh ] && . $HOME/etc/setenv.sh

#--- FUNC ------------------------------
do_shell_()
{
	cat <<-EndOfInlineData
		CHECKINTEGRITY_HOME=$HOME/component/checkintegrity
		CHECKINTEGRITY_VAR=\$VAR/checkintegrity

	EndOfInlineData
} #do_shell_()

#do_crontab_()
#{
#	# Get time for starting dailyCheck.sh from crontabSchedule settings
#	[ -f "$CONF/crontabSchedule.shi" ] && . $CONF/crontabSchedule.shi
#	[ -z "$DailyCheck" ] && DailyCheck="23 00"
#
#	cat <<-EOI
#		$DailyCheck * * * $CHECKINTEGRITY_HOME/dailyCheck.sh
#	EOI
#} #do_crontab_()


do_start_()
{
	[ ! -d "$CHECKINTEGRITY_VAR" ] && mkdir $CHECKINTEGRITY_VAR 2>/dev/null
	[ ! -e $CHECKINTEGRITY_VAR/integrity.conf ] && ln -s $CHECKINTEGRITY_HOME/integrity.conf $CHECKINTEGRITY_VAR/ 

} #do_start_()


#
# List files/tables to be backed up grouped by categories
#
# output lines should be in '<category> <type> <names>' format
#
do_listbackup_()
{
	cat <<-EOFLISTBACKUP
		config.checkintegrity FILE ${CHECKINTEGRITY_VAR#$HOME/}
	EOFLISTBACKUP
}

#--- MAIN ------------------------------

check_action_ $1
if [ 0 = $? ]; then
	do_$1_

else
	echo "--- Component checkintegrity [ctrl $$]: Bad command: $1" >&2
	exit 1

fi
