#! /bin/sh # # $Id: nsrwreg.sh,v 6.1.2.2 2006/04/26 19:32:50 castrv Exp $ # # 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. # # # To cope with shell syntax limitations, all necessary functions are # defined first, and the main switch over all supported architectures # is at the very end of this file. # # # Retrieve and store platform parameters # NWOS="`uname`" MACH="`uname -m`" # define some wizard specific 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 # # Check whether /nsr exists at all, and create /nsr/res as a minimum # prerequiste to get nsrexecd working, which will create the rest. In # theory this can only happen after a complete new install. # nsr_checknsr() { if [ ! -d /nsr/res ] then if [ ! -d /nsr ] then mkdir /nsr fi if [ -d /nsr ] then mkdir /nsr/res fi # /nsr/tmp is required by nsrwizreg if [ -d /nsr ]; then mkdir /nsr/tmp fi fi return 0 } clnt_nsrwizreg() { if [ "X${WIZ_REGISTRATION_PATH}" != "X" ]; then # check if file exists if [ ! -f ${WIZ_REGISTRATION_PATH}/${WIZ_REGISTRATION_BINARY} ]; then echo "WARNING: Registration failed because ${WIZ_REGISTRATION_PATH}/${WIZ_REGISTRATION_BINARY} was not found." echo " Please register manually." echo " Proceeding without the registration process." return else # to support 7.2 wizard connecting to this client # add NetWorker 7.2 client to wizard 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}" -a 2>/dev/null` rc=$? if [ "X${rc}" != "X0" ]; then echo "WARNING: Registration failed, please register manually." echo " Proceeding without the registration process." return fi # add NetWorker client to wizard 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}" -a 2>/dev/null` fi fi } console_nsrwizreg() { clnt_nsrwizreg # register wizard GUI if [ -f ${WIZ_CONSOLE_BINARY_PATH}/${WIZ_CONSOLE_BINARY} ]; then # add NetWorker client to 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 7.2 -f "${WIZ_CONSOLE_RES_FILE}" -a 2>/dev/null` rc=$? if [ "X${rc}" != "X0" ]; then echo "WARNING: Registration failed, please register manually." echo " Proceeding without the registration process." return fi # add NetWorker client to 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}" -a 2>/dev/null` fi } # # perform Linux registration # linux_nsrwizreg() { # rpm to calculate basedir console_nsrwizreg } # # perform Solaris registration # solaris_nsrwizreg() { # get the LGTOclnt installation directory bdir=`pkgparam LGTOclnt BASEDIR 2>/dev/null` WIZ_REGISTRATION_PATH=${bdir}/sbin WIZ_CONSOLE_BINARY_PATH=${bdir}/bin FILESYSTEM_DC_PATH=${bdir}/lib/nsr if [ "X${bdir}" = "X" ]; then # try SUNWebsc installation bdir=`pkgparam SUNWebsc BASEDIR 2>/dev/null` WIZ_REGISTRATION_PATH=${bdir}/sbin/nsr WIZ_CONSOLE_BINARY_PATH=${bdir}/bin/nsr FILESYSTEM_DC_PATH=${bdir}/lib/nsr fi console_nsrwizreg } # # perform AIX registration # aix_nsrwizreg() { FILESYSTEM_DC_SHARED_LIBRARY="libfsdc.o" FILESYSTEM_WIZ_SHARED_LIBRARY="libfswiz.o" WIZ_REGISTRATION_PATH=/usr/bin console_nsrwizreg } # # perform Tru64 registration # tru64_nsrwizreg() { WIZ_REGISTRATION_PATH=/usr/opt/networker/bin FILESYSTEM_DC_PATH=/usr/opt/networker/lib clnt_nsrwizreg } # # perform HP-UX registration # hpux_nsrwizreg() { FILESYSTEM_DC_SHARED_LIBRARY="libfsdc.sl" FILESYSTEM_WIZ_SHARED_LIBRARY="libfswiz.sl" WIZ_REGISTRATION_PATH=/opt/networker/bin WIZ_CONSOLE_BINARY_PATH=/opt/networker/bin FILESYSTEM_DC_PATH=/opt/networker/lib console_nsrwizreg } # # perform HPIA64 registration # hpia64_nsrwizreg() { FILESYSTEM_DC_SHARED_LIBRARY="libfsdc.so" WIZ_REGISTRATION_PATH=/opt/networker/bin FILESYSTEM_DC_PATH=/opt/networker/lib clnt_nsrwizreg } # # perform Darwin registration # darwin_nsrwizreg() { clnt_nsrwizreg } # # perform IRIX registration # irix_nsrwizreg() { clnt_nsrwizreg } # # This is the main() part of of the script, call whatever function # is approporate on the current machine. # nsr_checknsr case "${NWOS}.${MACH}" in Linux.*) linux_nsrwizreg ;; SunOS.*) solaris_nsrwizreg ;; AIX.*) aix_nsrwizreg ;; OSF1.alpha) tru64_nsrwizreg ;; HP-UX.9000/7*| HP-UX.9000/8*) hpux_nsrwizreg ;; HP-UX.ia64) hpia64_nsrwizreg ;; Darwin.*) darwin_nsrwizreg ;; IRIX*.*) irix_nsrwizreg ;; *) unknown_nsrwizreg ;; esac exit 0