#! /bin/sh # # $Id: nw_clnt_preremove.SunOS,v 1.7.16.1 2007/02/01 14:14:49 brownr1 Exp $ Copyright (c) 2005-2006, EMC Corporation. # # Copyright (c) 2005-2006 EMC Corporation. # # All rights reserved. This is an UNPUBLISHED work, and # comprises proprietary and confidential information of EMC. # Unauthorized use, disclosure, and distribution are strictly # prohibited. Use, duplication, or disclosure of the software # and documentation by the U.S. Government is subject to # restrictions set forth in a license agreement between the # Government and EMC or other written agreement specifying # the Government's rights to use the software and any applicable # FAR provisions, such as FAR 52.227-19. # PATH=/usr/sbin:/usr/bin:/sbin PRODUCT_NAME="Sun StorageTek EBS" #=============================================================================== # Function: stop_daemons # Summary: find nsr_shutdown and stop any running daemons #=============================================================================== stop_daemons() { if [ $PKGINST = LGTOclnt ]; then NSR_SHUTDOWN=${CLIENT_BASEDIR}/sbin/nsr_shutdown else NSR_SHUTDOWN=${CLIENT_BASEDIR}/sbin/nsr/nsr_shutdown fi [ -z "${NSR_SHUTDOWN}" ] && return # not installed [ ! -x "${NSR_SHUTDOWN}" ] && return # not executable ${NSR_SHUTDOWN} -l > /dev/null 2>&1 # no running daemons if [ $? -eq 0 ]; then echo "Shutting down the ${PRODUCT_NAME} daemons" ${NSR_SHUTDOWN} -q fi } #============================================================================== # Function: nsrwizreg # Summary: remove the nsrwizclnt and nsrwizcon res files #============================================================================== nsrwizreg(){ # define some variables FILESYSTEM_DC_SHARED_LIBRARY="libfsdc.so" FILESYSTEM_DC_PATH="/usr/lib/nsr" FILESYSTEM_WIZ_SHARED_LIBRARY="libfswiz.so" FILESYSTEM_PRODUCT_NICKNAME="FSWIZ" FILESYSTEM_PRODUCT_NAME="Filesystem Client" WIZ_CONSOLE_BINARY="nwwize" WIZ_CONSOLE_BINARY_PATH="/usr/bin" WIZ_REGISTRATION_BINARY="nsrwizreg" WIZ_REGISTRATION_PATH="/usr/sbin" WIZ_CONSOLE_RES_FILE="nsrwizcon.res" WIZ_CLIENT_RES_FILE="nsrwizclnt.res" bver=7.3 # get the LGTOclnt installation directory bdir=`pkgparam LGTOclnt BASEDIR 2>/dev/null` if [ "X${bdir}" = "X" ]; then # try SUNWebsc installation bdir=`pkgparam SUNWebsc BASEDIR 2>/dev/null` fi WIZ_REGISTRATION_PATH=${bdir}/sbin WIZ_CONSOLE_BINARY_PATH=${bdir}/bin FILESYSTEM_DC_PATH=${bdir}/lib/nsr if [ "X${WIZ_REGISTRATION_PATH}" != "X" ]; then # check if file exists if [ -f ${WIZ_REGISTRATION_PATH}/${WIZ_REGISTRATION_BINARY} ]; then # remove NetWorker 7.2 file system from client registration file `${WIZ_REGISTRATION_PATH}/${WIZ_REGISTRATION_BINARY} -t "${FILESYSTEM_PRODUCT_NICKNAME}" \ -n "${FILESYSTEM_PRODUCT_NAME}" \ -p ${FILESYSTEM_DC_PATH}/${FILESYSTEM_DC_SHARED_LIBRARY} \ -v 7.2 -f "${WIZ_CLIENT_RES_FILE}" -r 2>/dev/null` # remove Keystone NetWorker file system from client registration file `${WIZ_REGISTRATION_PATH}/${WIZ_REGISTRATION_BINARY} -t "${FILESYSTEM_PRODUCT_NICKNAME}" \ -n "${FILESYSTEM_PRODUCT_NAME}" \ -p ${FILESYSTEM_DC_PATH}/${FILESYSTEM_DC_SHARED_LIBRARY} \ -v ${bver} -f "${WIZ_CLIENT_RES_FILE}" -r 2>/dev/null` # remove NetWorker file system GUI from console registration file if [ -f ${WIZ_CONSOLE_BINARY_PATH}/${WIZ_CONSOLE_BINARY} ]; then # remove NetWorker client from wizard console registration file `${WIZ_REGISTRATION_PATH}/${WIZ_REGISTRATION_BINARY} -t "${FILESYSTEM_PRODUCT_NICKNAME}" \ -n "${FILESYSTEM_PRODUCT_NAME}" \ -p ${FILESYSTEM_DC_PATH}/${FILESYSTEM_WIZ_SHARED_LIBRARY} \ -v ${bver} -f "${WIZ_CONSOLE_RES_FILE}" -r 2>/dev/null` fi fi fi } #=============================================================================== # Function: main #=============================================================================== nsrwizreg stop_daemons exit 0