#!/bin/sh
# bpenableLN.sh $Revision: 1.2 $
# bcpyrght
#**************************************************************************
# Copyright 1993 - 1999 VERITAS Software Corporation. All Rights Reserved *
#**************************************************************************
# ecpyrght
#
# Shell script to enable the Lotus Notes Class Type
#

DB_DIR=/usr/openv/netbackup/db
ADMIN_DIR=/usr/openv/netbackup/bin/admincmd
EditScript=${DB_DIR}/bpenableLN.scr
DisplayName="Lotus Notes"

echo ""
echo "... Enabling the ${DisplayName} class type"
echo ""

if [ ! -r ${EditScript} ] ; then
    echo "Error: ${EditScript} does not exist or is not readable!"
else

    ${ADMIN_DIR}/bplicense -editfile ${EditScript} -textfile ${DB_DIR}/Class_att_defs

    bpstat=$?

    case ${bpstat} in
	0)
	    echo "Scheduling for ${DisplayName} successfully enabled"
	    ;;
	147)
	    echo "Warning: Scheduling for ${DisplayName} already enabled"
	    ;;
	*)
	    echo "Error: Scheduling for ${DisplayName} could not be enabled"
	    ;;
    esac
fi

echo ""
echo "... Creating the ${DisplayName} class template"
echo ""

CLASSNAME=LotusNotes
FILELIST="ALL_LOTUS_DATABASES BACKUP_TRANSACTION_LOGS"

${ADMIN_DIR}/bpcldelete ${CLASSNAME} -template 2>/dev/null

${ADMIN_DIR}/bpclassnew ${CLASSNAME} -template
${ADMIN_DIR}/bpclinfo ${CLASSNAME} -template -set -clienttype Lotus-Notes -inactive
${ADMIN_DIR}/bpclinclude ${CLASSNAME} -template -add ${FILELIST}
