#!/bin/sh # $Id: lotusnotes_config.sh,v 1.7 2006/11/15 18:36:40 #*************************************************************************** # $Copyright: Copyright (c) 2022 Veritas Technologies LLC. All rights reserved $ #*************************************************************************** # # The following variable is changed by the Makefile to a valid value. # NOTE: If build platforms are changed, the checks for this variable # must also be updated. # MACHINE=rs6000_61 # Intentionally set LC_ALL to C LC_ALL=C export LC_ALL # Intentionally set TMPDIR to /tmp. TMPDIR=/tmp BP_BIN=/usr/openv/netbackup/bin Q1="Please specify the Lotus Notes instance home path name (Example: /opt/lotus):" USAGE () { echo "" echo "USAGE:" echo " $0" exit 22 } trap trapped 1 2 3 15 trapped () { rm -f ${Q1_ANSW} ${Q1_ANSW}.error exit 1 } # # This function takes a string as input and echos it out # as a question with a prompt for an answer. Any answer # not beginning with y or Y is considered a no. # confirm () { echo "${1} (y/n) [n] " read ans case "${ans}" in Y*|y*) echo return 1 ;; *) echo return 0 ;; esac } # # Make sure this is being run from root. # ISROOT=`id | egrep "^uid=0\("` if [ "${ISROOT}" = "" ] ; then echo "" echo "$0 must be run while logged in as root." echo "" exit 1 fi if [ $# -ne 0 ] ; then USAGE fi Q1_ANSW=${TMPDIR}/LN_Q1.$$ rm -f ${Q1_ANSW} BIN_NAME_64=nblnagent64 TOOL_NAME=nblndb2 BIN_NAME=${BIN_NAME_64} if [ ! -f ${BP_BIN}/${BIN_NAME_64} -o ! -f ${BP_BIN}/${TOOL_NAME} ] ; then echo "" echo "ERROR: ${BP_BIN}/${BIN_NAME_64} or ${BP_BIN}/${TOOL_NAME} was not found." echo "ERROR: The Lotus Notes agent software has not been installed." echo "" trapped fi done=0 echo "" LN_INST="" while [ ${done} -ne 1 ] ; do echo ${Q1} read LN_INST if [ ! -d "${LN_INST}" ] ; then echo "" echo "Directory \"${LN_INST}\" does not exist." echo "If this Lotus Notes installation is part of a cluster and" echo "this node is inactive, this message may safely be" echo "ignored. Otherwise, check to see if Lotus Notes has been" echo "installed in \"${LN_INST}\"." echo "" if confirm "Do you want to exit this script?" then : else trapped fi else echo ${LN_INST} >> ${Q1_ANSW} echo "" if confirm "Do you have other Lotus Notes instances?" then done=1 fi fi done # # Determine platform to specify correct Lotus Notes path # Solaris: ${LN_INST}/notes/latest/sunspa # AIX: ${LN_INST}/notes/latest/ibmpow # Linux: ${LN_INST}/notes/latest/linux # if [ "${MACHINE}" = "solaris10" ] ; then LN_PATH=sunspa elif [ "${MACHINE}" = "rs6000_61" ] ; then LN_PATH=ibmpow elif [ "${MACHINE}" = "linuxR_x86_3.10.0" -o \ "${MACHINE}" = "linuxS_x86_4.4.73" ] ; then LN_PATH=linux fi # # Protect the value of INST with double quotes in case there is # a blank in the directory name. # while read INST do if [ ! -d "${INST}"/notes/latest/${LN_PATH} -o ! -f "${INST}"/bin/tools/startup ] ; then echo "" echo "INSTALLATION WARNING:" echo "Directory ${INST}/notes/latest/${LN_PATH} or file" echo "${INST}/bin/tools/startup does not exist." echo "If this Lotus Notes installation is part of a cluster and" echo "this node is inactive, this warning may safely be" echo "ignored. Otherwise, check to see if Lotus Notes has been" echo "installed in ${INST}." echo "" else # # Do some checks for the 32bit/64bit scenario. # Only 64bit is supported for Lotus Notes. # if file "${INST}"/notes/latest/"${LN_PATH}"/server 2>/dev/null | grep "64-bit" > /dev/null then is_64_bit=1 else is_64_bit=0 fi if [ ${is_64_bit} -eq 0 ] ; then echo "" echo "INSTALLATION WARNING:" echo "${INST}/bin/server is a 32 bit Domino server." echo "The 32 bit Domino server is not supported" echo "by NetBackup." echo "" else for TL in ${BIN_NAME} ${TOOL_NAME} ; do LINK_NAME=${TL} if [ ${TL} = 'nblnagent64' ] ; then TL=nblnagent fi if ls -ld "${INST}"/bin/${TL} 2>/dev/null | grep "^l" > /dev/null then rm -f "${INST}"/bin/${TL} elif [ -f "${INST}"/bin/${TL} ] ; then rm -f "${INST}"/bin/${TL}.org mv "${INST}"/bin/${TL} "${INST}"/bin/${TL}.org fi if ls -ld "${INST}"/notes/latest/${LN_PATH}/${TL} 2>/dev/null | grep "^l" > /dev/null then rm -f "${INST}"/notes/latest/${LN_PATH}/${TL} elif [ -f "${INST}"/notes/latest/${LN_PATH}/${TL} ] ; then rm -f "${INST}"/notes/latest/${LN_PATH}/${TL}.org mv "${INST}"/notes/latest/${LN_PATH}/${TL} "${INST}"/notes/latest/${LN_PATH}/${TL}.org fi echo "" echo "Linking ${INST}/bin/${TL} to tools/startup." /bin/ln -s tools/startup "${INST}"/bin/${TL} #if 64 bit Domino server link to nblnagent64 if [ "${TL}" = "${BIN_NAME}" -a ${is_64_bit} -eq 1 ] ; then LINK_NAME=${BIN_NAME_64} fi echo "Linking ${INST}/notes/latest/${LN_PATH}/${TL} to ${BP_BIN}/${LINK_NAME}." /bin/ln -s ${BP_BIN}/${LINK_NAME} "${INST}"/notes/latest/${LN_PATH}/${TL} done fi fi done < ${Q1_ANSW} # # Hitting trapped in the previous while doesn't actually exit this script # on some platforms so check here if last command executed was ok. If I # hit the trap in the while, I'll trap again and properly exit with a 1. # if [ $? -eq 0 -a ! -f ${Q1_ANSW}.error ] ; then rm -f ${Q1_ANSW} exit 0 else trapped fi