#! /bin/sh # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # # # Licensed Materials - Property of IBM # # Restricted Materials of IBM # # (C) COPYRIGHT International Business Machines Corp. 2003,2008 # All Rights Reserved # # US Government Users Restricted Rights - Use, duplication or # disclosure restricted by GSA ADP Schedule Contract with IBM Corp. # # IBM_PROLOG_END_TAG # %Z%%M% %I% %W% %G% %U% # #========================================================================= # Use this script to uninstall SAMP. # # Syntax: # uninstallSAM [options: see SAMP base reference] # # Output: # - rpm/installp program output from un-installation of each rpm # package/fileset un-installed. # List of all rpms/filesets left after uninstall. # - If any package is not installed NLS text for U04 will # be shown. If a prerequesite package of SAMP is required # by another package, this will be stated and the rpm will appear in # the list of packages left after uninstall. # - If a peer domain is Online uninstallSAM will not start. # "stoprpdomain" must be used to stop the peer-domain. # - detailed log of uninstallation in /tmp/uninstallSAM.<#>.log. # # Change Activity: # 20021018 ws Initial version # 20030218 ws add handling of arch s390x # 20030228 ws add handling rpm return code # 20030519 ws add power pc (ppc) # 20030701 ws V1.2 add NLS, convert shell type from ksh to bash # 20030730 ws V1.2 add arch ia64 # 20030924 ws add opteron x86_64 # 20030925 ws add packages for samnls and sam-policies # 20031203 ws use uninstallSAM.properties file # 20040312 ws add AIX (uninstallp) # 20040319 ws add sam.msg and rsct.*.msg packages # 20040420 ws merge with installp (AIX) # 20040623 ws sam 1.2 PTF1 sam-1.2.0.1 # 20040719 ws fix uninstall AIX lslpp problem reported by EJ # 20040928 ws sam 1.2 PTF2 sam-1.2.0.2 # 20050330 ws remove usage of AWK # 20050528 ws ws sam 2.1.0.0 integrate instsamadapter/rmsamadapter # 20051208 ws sam 2.1.1.0 add silent uninstall, etc. # 20051212 ws Add -d option (packages directory) # 20060202 ws fix PTM ...KKo does not stop uninstall on first error # 20060315 ws check for rsct.opt.storagerm package installed # 20060519 ws Fix false -d detection # 20060608 ws Fix PR1P0242RBa - StorageRM package is not installed with SAM base install # 20060613 ws Handle package xdrsl10 for s390 with SLES10 # fix cp cmd not found. # 20060801 ws fix PR1P0401WBl # 20060816 ws remove uninstallSAM from installed package (c001) # 20061020 ws remove sapolicies/db2 if sam.policies is not installed (c002). # 20061207 ws fix lack of 'lsrpdomain detection' and 'no error output' problems. # 20070306 ws Include handling of RSCT packages required by CSM # 20070604 ws Fix P2300610RKa Paused in Russian locale. # 20071002 ws support Solaris, Linux repackaged # 20071024 ws handle uninstall of rsct.64bit with and without rsct.cimrm correctly # 20080205 ws Fix P3100871JOE Uninstall Solaris lang packs # 20080208 ws Fix P3100882VVa # 20080422 ws Change sleep from 1 to 3 on uninstallSAMx, use $CPCMD -f for copy. # 20080507 rb Included GREP variable similar to installSAM and prereqSAM P3101628YKu (Solaris) # #========================================================================= # TODO: Consolidate all functions common in installSAM, prereqSAM, and uninstallSAM in one utility DISABLE_UINST=0 # 1 causes uninstallation to be suppressed DEBUG=0 # 1 causes additional messages to be displayed #PN=`echo $0 | sed s/'.*\/'//` # strip program name from call arg[0] #DIR=`echo $0 | sed s/$PN$//` # strip directory from call arg[0] PN=`basename $0` # strip program name from call arg[0] DIR=`dirname $0` # strip directory from call arg[0] TMP_DIR=/tmp TMP_STDERR=$TMP_DIR/$PN.$$.err TMP_STDOUT=$TMP_DIR/$PN.$$.out TMP_FIRST_STDERR="${TMP_STDERR}1" TMP_FIRST_STDOUT="${TMP_STDOUT}1" UNINST_NAME=uninstallSAM # messages are in uninstallSAM.*.msg files UINST_LOG='' SAMP_DIR=/opt/IBM/tsamp ADAPTER_DIR=${SAMP_DIR}/sam UNINST_DIR=${ADAPTER_DIR}/uninst # c001 TMP_DIR=/tmp ADAPTER=samadapter SCRIPT=$PN': ' RSCT_DIR="/usr/sbin/rsct" RSCT_BIN_DIR="$RSCT_DIR/bin" POLICIES_DIR="$RSCT_DIR/sapolicies" DB2_POLICIES_DIR="$POLICIES_DIR/db2" OS=`uname -s` # distinguish "Linux" "AIX" before trying to determine platform DATE=`date` HOST_NAME=`hostname` PLATFORM="" ERROR=0 # error flag if multiple versions FIRST_ERROR="" # capture text of first error ANY_UINST=0 # English only messages: ENMSG_NOARCH="${SCRIPT}Cannot determine architecture -exit." ENMSG_NOLANG="${SCRIPT}Cannot determine language - will use English." ENMSG_NONLS="${SCRIPT}The language currently set is not supported :" ENMSG_LANGINST="${SCRIPT}If you want to cancel uninstallSAM to set a supported language, type 'y':" ENMSG_NODEFLANG="${SCRIPT}Default language not found -exit" ENMSG_CONTEN="${SCRIPT}Will continue in English" ENMSG_LOG_STARTED="${SCRIPT}>>> Uninstallation on $HOST_NAME - log started :" ENMSG_LOG_ENDED="${SCRIPT}<<< Uninstallation on $HOST_NAME - log ended :" ENMSG_NO_DIR="${SCRIPT}Directory specified with option -d does not exist:" ENMSG_NO_PKGDIR="${SCRIPT}Directory specified with option -d does not contain required files:" ENMSG_NO_LOGDIR="${SCRIPT}Unable to create log file. Maybe the path does not exist:" USAGE1="Usage:" USAGE2=" uninstallSAM [-d inst_pkg_dir] [-l log_file]" # Return codes from installSAM script RC_OK=0 RC_UNINSTALLER_ERROR=1 RC_DOMAIN_ONLINE=2 RC_UNINST_UNABLE=3 RC_USER_CANCEL=4 RC_ADAPTER=5 # Check if called for remove of uninstallSAM # make sure we call the renamed script with x appended if [ `pwd` = $TMP_DIR ] && [ $PN = ${UNINST_NAME}x ] ; then sleep 3 # wait a bit to make sure the other instance is done rm -rf $ADAPTER_DIR rmdir $SAMP_DIR >/dev/null 2>&1 #echo "uninstallSAMx: cleaned up $ADAPTER_DIR" exit 0 fi # options for silent uninstall OPTIONS=$* # --silent # -d # -l OPT_SILENT=0 OPT_DIR='' OPT_LOG_FILE='' if [ $DEBUG -eq 1 ] ; then echo "call: '"$0"'" echo "Program name: '"$PN"'" echo "Directory: '"$DIR"'" fi #---------------------------------- # functions #---------------------------------- # function getcpcmd # get cp command with its path # Prereq: $OS must be set 'uname -s' # return cp command with path getcpcmd () { CPCMD=cp WRC=0 case "$OS" in AIX|SunOS) CPCMD=`which cp 2>/dev/null` WRC=$? ;; Linux) CPCMD=`which --skip-alias cp 2>/dev/null` WRC=$? if [ $WRC -ne 0 ] ; then CPCMD=`which cp 2>/dev/null` WRC=$? fi ;; esac if [ $WRC -ne 0 ] ; then CPCMD=cp fi echo $CPCMD } # function logit # log and conditionally echo message # parameters: # $1 message # Side effects: # if OPT_SILENT==1 do not echo message # log message in file installSAM.PID.log # logit () { echo "$1" >> $UINST_LOG if [ $OPT_SILENT -eq 0 ] ; then echo "$1" fi } # function makeLog # paramters: # $1 prefix of log file # Make log file of the form: /tmp/$1.#.log # where # is a number that does not exist yet in # existing log files. # returns log file name. makeLog () { NUM=`ls /tmp/$1.*.log 2>/dev/null | sed s/"\/tmp\/$1\."//g | sed s/"\.log"//g | sort -nr |head -1` if [ -n "$NUM" ] ; then NUM=`expr $NUM + 1` else NUM=1 fi INST_LOG=/tmp/$1.$NUM.log echo $INST_LOG } # function uinstexit. # exit uninstallation with return code. # parameters: # $1 RC # $2 if exists then skip processing acc. to flag # "NONE" no output # "NONLS" no NLS related text # Side effects: # exits script after logging. # uinstexit () { # remove first error file if [ -r "$TMP_FIRST_STDERR" ] ; then rm $TMP_FIRST_STDERR fi # remove first output file if [ -r "$TMP_FIRST_STDOUT" ] ; then rm $TMP_FIRST_STDOUT fi # remove stderr file if [ -r "$TMP_STDERR" ] ; then rm $TMP_STDERR fi # remove stdout file if [ -r "$TMP_STDOUT" ] ; then rm $TMP_STDOUT fi if [ -z "$2" ] || [ "$2" = "0" ] || [ "$2" = "NONLS" ] ; then DATE=`date` echo "$ENMSG_LOG_ENDED $DATE" >> $UINST_LOG fi exit $1 } # function getASCII # get the ASCII NLS string from $NLS_FILE # used for uninstallSAM.properties - English # parameters: # $1 ASCII key to search for NLS string # $2 ==1, if removal of trailing CR(13) is required # return: # ASCII NLS string with $SCRIPT prefix # getASCII () { # find NLS text for pattern xxx= R=${SCRIPT}`cat $NLS_FILE | grep $1= | sed s/$1=//` #echo "R='$R'" if [ "$R" = "$SCRIPT" ] ; then # assume: not yet available as translated text, use English R=${SCRIPT}`cat "${MSG_DIR}/${UNINST_NAME}.en_US.msg" | grep $1= | sed s/$1=//` fi if [ "$R" != "$SCRIPT" ] && [ $2 -eq 1 ] ; then # remove CR #R=`echo $R |$AWK 'BEGIN {RS="\x0D\x0A"} {gsub("\x0D\x0A","\x0A"`; print; exit;}'` RCNT=`echo $R | wc -c` RCNT=`expr $RCNT - 2` R=`echo $R | cut -b1-$RCNT` fi echo $R } # function mapLanguage # get similar language: e.g. # if $1 is en_US.iso885915 then map to en_US # parameters: # $1 language currently set # mapLanguage () { MAPPED_LANG=$NLS_LANG # try map utf8 -> UTF-8 IS_UTF8=`echo $1 | grep -c utf8` if [ $IS_UTF8 -ne 0 ] ; then MAPPED_LANG=`echo $1 | sed s/'.utf8'/'.UTF-8'/` else # not UTF-8 # extract first part like 'en_' from 'en_UK' LANG_PREFIX=`echo $1 | sed s/_.*/_/` case "$LANG_PREFIX" in en_) MAPPED_LANG=$LANG_PREFIX"US" ;; de_) MAPPED_LANG=$LANG_PREFIX"DE" ;; es_) MAPPED_LANG=$LANG_PREFIX"ES" ;; fr_) MAPPED_LANG=$LANG_PREFIX"FR" ;; it_) MAPPED_LANG=$LANG_PREFIX"IT" ;; pt_) MAPPED_LANG=$LANG_PREFIX"BR" ;; ja_) IS_EUC=`echo $1 | grep -ic eucjp` if [ $IS_EUC -ne 0 ] ; then MAPPED_LANG=$LANG_PREFIX"JP.eucJP" else MAPPED_LANG=$LANG_PREFIX"JP" fi ;; ko_) IS_EUC=`echo $1 | grep -ic euckr` if [ $IS_EUC -ne 0 ] ; then MAPPED_LANG=$LANG_PREFIX"KR.eucKR" else MAPPED_LANG=$LANG_PREFIX"KR" fi ;; zh_) IS_GBK=`echo $1 | grep -ic gbk` if [ $IS_GBK -ne 0 ] ; then MAPPED_LANG=$LANG_PREFIX"CN.GBK" break fi IS_GB18=`echo $1 | grep -ic gb18030` if [ $IS_GB18 -ne 0 ] ; then MAPPED_LANG=$LANG_PREFIX"CN.GB18030" break fi IS_GB23=`echo $1 | grep -ic gb2312` if [ $IS_GB23 -ne 0 ] ; then MAPPED_LANG=$LANG_PREFIX"CN.GB2312" break fi IS_TWEUC=`echo $1 | grep -ic euctw` if [ $IS_TWEUC -ne 0 ] ; then MAPPED_LANG=$LANG_PREFIX"TW.eucTW" break fi IS_TWBIG5=`echo $1 | grep -ic big5` if [ $IS_TWBIG5 -ne 0 ] ; then MAPPED_LANG=$LANG_PREFIX"TW.Big5" break fi IS_TW=`echo $1 | grep -ic tw` if [ $IS_TW -ne 0 ] ; then MAPPED_LANG=$LANG_PREFIX"TW" else MAPPED_LANG=$LANG_PREFIX"CN" fi ;; esac fi #echo "mapped to: "$MAPPED_LANG NLS_LANG=$MAPPED_LANG } # function uninstalln # uninstall packages # parameters: # $1 packages as used by rpm/installp # uninstalln () { PKGS="" RC=0 NUMPKG=0 for APKG in $1 do URC=1 case "$OS" in Linux) PKG=`rpm -q $APKG 2>/dev/null` URC=$? ;; SunOS) PKG=`pkginfo -x $APKG 2>/dev/null | head -1 | cut -f1 -d' '` URC=$? ;; AIX) lslpp -l "$APKG*" 2>/dev/null URC=$? if [ $URC -eq 0 ] ; then PKG=$APKG fi ;; esac if [ -z "$PKG" ] || [ $URC -ne 0 ] ; then # package does not exists logit "$U14 $APKG" PKG="" else # add to packages to be uninstalled PKGS=$PKGS" "$PKG NUMPKG=`expr $NUMPKG + 1` fi done if [ $NUMPKG -ne 0 ] ; then logit "$U02" for APKG in $PKGS do logit " $APKG" done if [ $DISABLE_UINST -ne 1 ] ; then UINST_CMD='' case "$OS" in Linux) UINST_CMD="rpm -e $PKGS" rpm -e $PKGS 1>$TMP_STDOUT 2>$TMP_STDERR RC=$? ;; SunOS) # until we support multiple packages and # require interaction loop through packages for APKG in $PKGS do # Uninstall one by one UINST_CMD="pkgrm -n -a $PKG_ADM_FILE $APKG" pkgrm -n -a $PKG_ADM_FILE $APKG 1>$TMP_STDOUT 2>$TMP_STDERR RC=$? if [ $RC -ne 0 ] ; then #echo "test:: uninstall failed with RC:$RC" >> $INST_LOG break fi done ;; AIX) UINST_CMD="installp -ug $PKGS" installp -ug $PKGS 1>$TMP_STDOUT 2>$TMP_STDERR RC=$? ;; esac echo "$U12 '$UINST_CMD' >:$RC" >> $UINST_LOG if [ $RC -ne 0 ] ; then # rpm/installp failed with rc!=0 ERT="$U05 $RC : $PKGS" logit "$ERT" if [ -z "$FIRST_ERROR" ] ; then # save first error if install failed FIRST_ERROR=$ERT # save stderr into first-error-file if [ -r "$TMP_STDERR" ] ; then $CPCMD $TMP_STDERR $TMP_FIRST_STDERR fi # save stdout into first-output-file if [ -r "$TMP_STDOUT" ] ; then $CPCMD $TMP_STDOUT $TMP_FIRST_STDOUT fi fi else ANY_UINST=1 fi else echo "would do $CMD $PKGS" fi fi if [ $RC -ne 0 ] ; then ERROR=1 fi return $RC } #--- function startRemoveMe c001 # Copy script required for removal of uninstallSAM to /tmp directory # and start removal script # Steps: # startRemoveMe () { if [ -x "${UNINST_DIR}/${UNINST_NAME}" ] && [ -d "$TMP_DIR" ] ; then # 2. copy uninstallSAM to tmp directory and append x to rename # in case an instance of installSAM was copied to /tmp by user $CPCMD -f ${UNINST_DIR}/${UNINST_NAME} ${TMP_DIR}/${UNINST_NAME}x # execute script to do cleanup cd $TMP_DIR /usr/bin/nohup $TMP_DIR/${UNINST_NAME}x >$TMP_DIR/${UNINST_NAME}x.out >/dev/null 2>&1 & fi } logExit () { UINST_RC=0 # check for errors if [ $ERROR -eq 1 ] ; then UINST_RC=$RC_UNINSTALLER_ERROR logit "$U11" if [ -n "$FIRST_ERROR" ] ; then # logs installer error return code logit "$FIRST_ERROR" fi if [ -r "$TMP_FIRST_STDERR" ] ; then if [ $OPT_SILENT -eq 0 ] ; then cat $TMP_FIRST_STDERR fi cat $TMP_FIRST_STDERR >> $UINST_LOG logit "" fi if [ -r "$TMP_FIRST_STDOUT" ] ; then if [ $OPT_SILENT -eq 0 ] ; then cat $TMP_FIRST_STDOUT fi cat $TMP_FIRST_STDOUT >> $UINST_LOG logit "" fi fi if [ $ANY_UINST -eq 0 ] ; then logit "$U13" fi } #--- function makePkgAdminFile # Make file for SunOS package admin. # pkgadd -a can be used to suppress interaction # Returns path and name of file makePkgAdminFile () { PKG_ADM_FILE=`rmvPkgAdminFile` touch $PKG_ADM_FILE echo "mail=" > $PKG_ADM_FILE echo "conflict=nochange" >> $PKG_ADM_FILE echo "setuid=nocheck" >> $PKG_ADM_FILE echo "action=nocheck" >> $PKG_ADM_FILE echo $PKG_ADM_FILE } #--- function rmvPkgAdminFile # Remove package admin file for SunOS. # Returns path and name of file rmvPkgAdminFile () { PKG_ADM_FILE=/tmp/pkgadmfile.com.ibm.sunos rm -f $PKG_ADM_FILE echo $PKG_ADM_FILE } # Check if any help option is in options # $1 options # # Rules: # - If any help like option is detected, display usage and exit. # checkHelp () { IS_HELP=`echo $1 | $GREP -Ec "\-h|\-help|\-\-help|\-\?|\?"` if [ $IS_HELP -ne 0 ] ; then echo "$USAGE1" echo "$USAGE2" exit 1 fi } ############################## Begin uninstallation processing ################################### # package extension Linux or SunOS PKGEXT= case "$OS" in AIX) PLATFORM=AIX ;; Linux) PLATFORM=`arch` # platform of target Linux machine PKGEXT=rpm ;; SunOS) PLATFORM=`mach` # platform of target SunOS machine PKGEXT=pkg ;; *) logit "$ENMSG_NOARCH" uinstexit $RC_UINST_UNABLE "NONLS" ;; esac GREP= if [ "$OS" = SunOS ] ; then GREP=/usr/xpg4/bin/grep else GREP=grep fi # get the copy command CPCMD=`getcpcmd` if [ -n "$OPTIONS" ] ; then checkHelp "$OPTIONS" # -l option #OPT_LOG_FILE=`echo $OPTIONS | grep "\-l" | sed s/".*\-l "// | sed s/" --.*"//` Fix false -d detection OPT_LOG_FILE=`echo " $OPTIONS" | grep " \-l " | sed s/".* \-l "// | sed s/" -.*"//` # --silent OPT_SILENT=`echo $OPTIONS | grep -c "\-\-silent"` fi # create new uninstall log from either -l logfile or default if [ -n "$OPT_LOG_FILE" ] ; then UINST_LOG=$OPT_LOG_FILE else UINST_LOG=`makeLog $PN` fi touch $UINST_LOG >/dev/null if [ $? -ne 0 ] ; then if [ $OPT_SILENT -eq 0 ] ; then echo "$ENMSG_NO_LOGDIR $UINST_LOG" fi uinstexit $RC_UNINST_UNABLE "NONE" fi echo "$ENMSG_LOG_STARTED $DATE" > $UINST_LOG # set all options if [ -n "$OPTIONS" ] ; then # silent uninstall options # -d option #OPT_DIR=`echo $OPTIONS | grep "\-d" | sed s/".*\-d "// | sed s/" --.*"//` Fix false -d detection OPT_DIR=`echo " $OPTIONS" | grep " \-d " | sed s/".* \-d "// | sed s/" -.*"//` if [ -n "$OPT_DIR" ] ; then if [ ! -d "$OPT_DIR" ] ; then logit "$ENMSG_NO_DIR $OPT_DIR" uinstexit $RC_UNINST_UNABLE "NONLS" fi fi fi echo "OPTIONS = $OPTIONS" >> $UINST_LOG echo "OPT_SILENT = $OPT_SILENT" >> $UINST_LOG # determine architecture ARCH='' COUNT=`echo $PLATFORM | grep -c "^i[3-6]86$"` if [ $COUNT -eq 1 ] ; then ARCH=i386 fi COUNT=`echo $PLATFORM | grep -c "^x86_64$"` if [ $COUNT -eq 1 ] ; then ARCH=i386 fi COUNT=`echo $PLATFORM | grep -c "^ia64"` if [ $COUNT -eq 1 ] ; then ARCH=i386 fi COUNT=`echo $PLATFORM | grep -c "^s390"` if [ $COUNT -eq 1 ] ; then ARCH=s390 fi COUNT=`echo $PLATFORM | grep -c "^ppc"` if [ $COUNT -eq 1 ] ; then ARCH=ppc fi COUNT=`echo $PLATFORM | grep -c "^sparc"` if [ $COUNT -eq 1 ] ; then ARCH=sparc fi COUNT=`echo $PLATFORM | grep -c "^AIX"` if [ $COUNT -eq 1 ] ; then ARCH= # use only OS name fi # Check Architecture if [ -z "$ARCH" ] && [ "$OS" != AIX ] ; then logit "$ENMSG_NOARCH" uinstexit $RC_UNINST_UNABLE "NONLS" fi OS_ARCH_DIR= if [ "$OS" = AIX ] ; then OS_ARCH_DIR=$OS else OS_ARCH_DIR=$OS/$ARCH fi if [ -n "$OPT_DIR" ] ; then if [ -d "${OPT_DIR}/$OS_ARCH_DIR" ] ; then DIR=$OPT_DIR else logit "$ENMSG_NO_PKGDIR $OPT_DIR" uinstexit $RC_UINST_UNABLE "NONLS" fi fi PKGDIR=${DIR}/$OS_ARCH_DIR LINUX_OR_SOLARIS=0 if [ "$OS" = "Linux" ] || [ "$OS" = "SunOS" ] ; then LINUX_OR_SOLARIS=1 fi # extract from LANG, LC_ALL, or LC_CTYPE NLS_LANG=`locale | grep "LANG=" | sed s/LANG=// | sed 's/\"//g'` 2>/dev/null if [ -z "$NLS_LANG" ] ; then NLS_LANG=`locale | grep "LC_ALL=" | sed s/LC_ALL=// | sed 's/\"//g'` 2>/dev/null if [ -z "$NLS_LANG" ] ; then NLS_LANG=`locale | grep "LC_CTYPE=" | sed s/LC_CTYPE=// | sed 's/\"//g'` 2>/dev/null if [ -z "$NLS_LANG" ] ; then logit "$ENMSG_NOLANG" NLS_LANG=en_US fi fi fi if [ "$NLS_LANG" = "POSIX" ] || [ "$NLS_LANG" = "C" ] ; then NLS_LANG=en_US fi if [ $DEBUG -eq 1 ] ; then echo T:language detected: $NLS_LANG #test #NLS_LANG=en # for test only NLS_LANG=de_DE # for test only fi MSG_DIR= case "$OS" in AIX|Linux|SunOS) MSG_DIR="${DIR}/${OS}/msg" ;; esac NLS_FILE="${MSG_DIR}/${UNINST_NAME}.$NLS_LANG.msg" #echo "try to find: "$NLS_FILE if [ ! -r "$NLS_FILE" ] ; then # try to map to similar language mapLanguage $NLS_LANG NLS_FILE="${MSG_DIR}/${UNINST_NAME}.$NLS_LANG.msg" if [ ! -r "$NLS_FILE" ] ; then # fall back to English logit "$ENMSG_NONLS $NLS_LANG" logit "" logit "$ENMSG_LANGINST" logit "" if [ $OPT_SILENT -eq 0 ] ; then read RES if [ "$RES" = "y" ] || [ "$RES" = "Y" ] ; then uinstexit $RC_USER_CANCEL "NONLS" fi fi logit "$ENMSG_CONTEN" NLS_FILE="${MSG_DIR}/${UNINST_NAME}.en_US.msg" if [ ! -r "$NLS_FILE" ] ; then echo "$ENMSG_NODEFLANG" uinstexit $RC_UNINST_UNABLE "NONLS" fi fi fi #echo "NLS_LAN:"$NLS_LANG #echo "NLS_FILE:"$NLS_FILE #cat $NLS_FILE if [ $DEBUG -eq 1 ] ; then echo T:use language-texts in file: $NLS_FILE # test fi # list of messages (from installSAM.properties) # U01=Uninstalling System Automation on platform: # U02=Uninstalling # U03=System Automation and prerequisites left after uninstall: # U04=Package does not exist: # U05=Error: rpm failed with return-code: # U06=Some RSCT peer domain is online: # U07=It must be stopped before uninstall can proceed: # U08=Use stoprpdomain to stop the domain - then try again # U09=Architecture not supported: # U10=Stop the end-to-end automation management adapter, using command 'samadapter stop'. # U11=Any packages failed uninstallation. See details below: # U12=Uninstallation command: # U13=No uninstallation was performed. # U14=Package is not installed: # U15=The following package must be uninstalled before package sam can be uninstalled: # U16=Error: 'samadapter' is running. Stop samadapter with command 'samadapter stop'. Then re-try uninstallation. # get ASCII texts from keys U01=`getASCII "U01" 1`' ' U02=`getASCII "U02" 1`' ' U03=`getASCII "U03" 1` U04=`getASCII "U04" 1` U05=`getASCII "U05" 1`' ' U06=`getASCII "U06" 1` U07=`getASCII "U07" 1` U08=`getASCII "U08" 1` U09=`getASCII "U09" 1`' ' U10=`getASCII "U10" 1`' ' U11=`getASCII "U11" 1`' ' U12=`getASCII "U12" 1`' ' U13=`getASCII "U13" 1`' ' U14=`getASCII "U14" 1` U15=`getASCII "U15" 1`' ' #========================================================= # check if a domain is online and if true exit if [ -x "${RSCT_BIN_DIR}/lsrpdomain" ] ; then ONLINE=`LANG=C lsrpdomain | grep "Online"` if [ -n "$ONLINE" ] ; then logit "$U06" if [ $OPT_SILENT -eq 0 ] ; then lsrpdomain fi lsrpdomain > $UINST_LOG logit "$U07" logit "$U08" uinstexit $RC_DOMAIN_ONLINE fi fi # check if samadapter is running - must be stopped if [ -x "$ADAPTER_DIR/bin/samadapter" ] ; then # command exists - see if adapter is started $ADAPTER_DIR/bin/samadapter status >/dev/null RC=$? if [ $RC -eq 1 ] ; then # is online logit "$U10" uinstexit $RC_ADAPTER fi fi #========================================================= # Execute uninstall commands logit "$U01$PLATFORM" if [ "$OS" = SunOS ] ; then PKG_ADM_FILE=`makePkgAdminFile` fi #========================================================= # >>> uninstall package "sam.adapter" # if [ "$OS" = Linux ] || [ "$OS" = AIX ] ; then uninstalln "sam.adapter" else uninstalln "IBMsamAdapter" fi RC=$? if [ $RC -ne 0 ] ; then logExit uinstexit $RC_UNINSTALLER_ERROR fi #========================================================= # >>> uninstall package "sam.msg" (ITSAMP NLS) # if [ $LINUX_OR_SOLARIS -eq 1 ] ; then # not AIX # sam if [ "$OS" = Linux ] ; then uninstalln "sam.msg.de_DE \ sam.msg.de_DE.ISO-8859-1 \ sam.msg.de_DE@euro \ sam.msg.de_DE.UTF-8" uninstalln "sam.msg.es_ES \ sam.msg.es_ES.ISO-8859-1 \ sam.msg.es_ES@euro \ sam.msg.es_ES.UTF-8" uninstalln "sam.msg.fr_FR \ sam.msg.fr_FR.ISO-8859-1 \ sam.msg.fr_FR@euro \ sam.msg.fr_FR.UTF-8" uninstalln "sam.msg.it_IT \ sam.msg.it_IT.ISO-8859-1 \ sam.msg.it_IT@euro \ sam.msg.it_IT.UTF-8" uninstalln "sam.msg.ja_JP.eucJP \ sam.msg.ja_JP.UTF-8" uninstalln "sam.msg.ko_KR.eucKR \ sam.msg.ko_KR.UTF-8" uninstalln "sam.msg.pt_BR \ sam.msg.pt_BR.UTF-8" uninstalln "sam.msg.zh_CN.GB2312 \ sam.msg.zh_CN.GB18030 \ sam.msg.zh_CN.GBK \ sam.msg.zh_CN.UTF-8" uninstalln "sam.msg.zh_TW \ sam.msg.zh_TW.Big5 \ sam.msg.zh_TW.eucTW \ sam.msg.zh_TW.UTF-8" else # Solaris uninstalln "IBMsamMsg-de_DE-ISO8859-1 \ IBMsamMsg-de_DE-ISO8859-15 \ IBMsamMsg-de_DE-UTF-8" uninstalln "IBMsamMsg-es_ES-ISO8859-1 \ IBMsamMsg-es_ES-ISO8859-15 \ IBMsamMsg-es_ES-UTF-8" uninstalln "IBMsamMsg-fr_FR-ISO8859-1 \ IBMsamMsg-fr_FR-ISO8859-15 \ IBMsamMsg-fr_FR-UTF-8" uninstalln "IBMsamMsg-it_IT-ISO8859-1 \ IBMsamMsg-it_IT-ISO8859-15 \ IBMsamMsg-it_IT-UTF-8" uninstalln "IBMsamMsg-ja_JP-eucJP \ IBMsamMsg-ja_JP-UTF-8" uninstalln "IBMsamMsg-ko_KR-EUC \ IBMsamMsg-ko_KR-UTF-8" uninstalln "IBMsamMsg-pt_BR-UTF-8 \ IBMsamMsg-pt_BR-ISO8859-1" uninstalln "IBMsamMsg-zh_CN-GB18030 \ IBMsamMsg-zh_CN-GBK \ IBMsamMsg-zh_CN-UTF-8 \ IBMsamMsg-zh_CN-EUC" uninstalln "IBMsamMsg-zh_TW-BIG5 \ IBMsamMsg-zh_TW-EUC \ IBMsamMsg-zh_TW-UTF-8" fi else # is AIX uninstalln "sam.msg.DE_DE" uninstalln "sam.msg.ES_ES" uninstalln "sam.msg.FR_FR" uninstalln "sam.msg.IT_IT" uninstalln "sam.msg.JA_JP" uninstalln "sam.msg.KO_KR" uninstalln "sam.msg.PT_BR" uninstalln "sam.msg.ZH_CN" uninstalln "sam.msg.ZH_TW" # is already uninstalled with the above #uninstall1 "sam.msg.Ja_JP" #uninstall1 "sam.msg.Zh_CN" #uninstall1 "sam.msg.Zh_TW" #uninstall1 "sam.msg.de_DE" #uninstall1 "sam.msg.es_ES" #uninstall1 "sam.msg.fr_FR" #uninstall1 "sam.msg.it_IT" #uninstall1 "sam.msg.ja_JP" #uninstall1 "sam.msg.ko_KR" #uninstall1 "sam.msg.pt_BR" #uninstall1 "sam.msg.zh_TW" fi #========================================================= # >>> uninstall package "sam" (SA for Linux Manager) # if [ $LINUX_OR_SOLARIS -eq 1 ] ; then if [ "$OS" = Linux ] ; then uninstalln sam else # Solaris uninstalln IBMsam fi RC=$? else uninstalln sam.core RC=$? fi if [ $RC -ne 0 ] ; then logExit uinstexit $RC_UNINSTALLER_ERROR fi if [ "$OS" = Linux ] ; then # Check if xdrsl10 is installed rpm -q xdrsl10 >/dev/null if [ $? -eq 0 ] ; then uninstalln "xdrsl10" RC=$? if [ $RC -ne 0 ] ; then logExit uinstexit $RC_UNINSTALLER_ERROR fi fi fi # uninstall optional storagerm if [ $LINUX_OR_SOLARIS -eq 1 ] ; then # Check if rsct.opt.storagerm is installed case "$OS" in Linux) rpm -q rsct.opt.storagerm >/dev/null INSTRC=$? ;; SunOS) pkginfo -x IBMrsctOptStoragerm >/dev/null INSTRC=$? ;; esac if [ $INSTRC -eq 0 ] ; then if [ "$OS" = Linux ] ; then uninstalln "rsct.opt.storagerm" else uninstalln IBMrsctOptStoragerm fi RC=$? if [ $RC -ne 0 ] ; then logExit uinstexit $RC_UNINSTALLER_ERROR fi fi fi # uninstall RSCT only, if NOT AIX if [ $LINUX_OR_SOLARIS -eq 1 ] ; then # Check if rsct.64bit and rsct.cimrm are installed and skip uninstall of the rest if so. INST64BIT=0 INSTCIMRM=0 case "$OS" in Linux) rpm -q rsct.64bit >/dev/null 2>&1 INSTRC=$? if [ $INSTRC -eq 0 ] ; then INST64BIT=1 fi rpm -q rsct.core.cimrm >/dev/null 2>&1 INSTRC=$? if [ $INSTRC -eq 0 ] ; then INSTCIMRM=1 fi ;; SunOS) pkginfo -x IBMrsct64bit >/dev/null 2>&1 INSTRC=$? if [ $INSTRC -eq 0 ] ; then INST64BIT=1 INSTCIMRM=0 # never installed fi ;; esac # Check if rsct.64bit is installed and rsct.core.cimrm is NOT installed # uninstall 64 bit if [ $INST64BIT -eq 1 ] && [ $INSTCIMRM -eq 0 ] ; then #========================================================= # >>> uninstall package "rsct.64bit" files # if [ "$OS" = Linux ] ; then uninstalln "rsct.64bit" else # Solaris uninstalln "IBMrsct64bit" fi INST64BIT=0 fi # Check if rsct.core.cimrm is installed and skip uninstall of the rest if so. if [ $INST64BIT -eq 0 ] && [ $INSTCIMRM -eq 0 ] ; then # rsct.64bit and rsct.cimrm are NOT installed, can remove rsct.basic.*. #========================================================= # >>> uninstall packages "rsct.basic.*.msg" files # # rsct.basic msg if [ "$OS" = Linux ] ; then uninstalln "rsct.basic.msg.de_DE \ rsct.basic.msg.de_DE.ISO-8859-1 \ rsct.basic.msg.de_DE@euro \ rsct.basic.msg.de_DE.UTF-8" uninstalln "rsct.basic.msg.es_ES \ rsct.basic.msg.es_ES.ISO-8859-1 \ rsct.basic.msg.es_ES@euro \ rsct.basic.msg.es_ES.UTF-8" uninstalln "rsct.basic.msg.fr_FR \ rsct.basic.msg.fr_FR.ISO-8859-1 \ rsct.basic.msg.fr_FR@euro \ rsct.basic.msg.fr_FR.UTF-8" uninstalln "rsct.basic.msg.it_IT \ rsct.basic.msg.it_IT.ISO-8859-1 \ rsct.basic.msg.it_IT@euro \ rsct.basic.msg.it_IT.UTF-8" uninstalln "rsct.basic.msg.ja_JP.eucJP \ rsct.basic.msg.ja_JP.UTF-8" uninstalln "rsct.basic.msg.ko_KR.eucKR \ rsct.basic.msg.ko_KR.UTF-8" uninstalln "rsct.basic.msg.pt_BR \ rsct.basic.msg.pt_BR.UTF-8" uninstalln "rsct.basic.msg.zh_CN.GB2312 \ rsct.basic.msg.zh_CN.GB18030 \ rsct.basic.msg.zh_CN.GBK \ rsct.basic.msg.zh_CN.UTF-8" uninstalln "rsct.basic.msg.zh_TW \ rsct.basic.msg.zh_TW.Big5 \ rsct.basic.msg.zh_TW.eucTW \ rsct.basic.msg.zh_TW.UTF-8" else # Solaris uninstalln "IBMrsctBasMsg-de_DE-ISO8859-1 \ IBMrsctBasMsg-de_DE-ISO8859-15 \ IBMrsctBasMsg-de_DE-UTF-8" uninstalln "IBMrsctBasMsg-es_ES-ISO8859-1 \ IBMrsctBasMsg-es_ES-ISO8859-15 \ IBMrsctBasMsg-es_ES-UTF-8" uninstalln "IBMrsctBasMsg-fr_FR-ISO8859-1 \ IBMrsctBasMsg-fr_FR-ISO8859-15 \ IBMrsctBasMsg-fr_FR-UTF-8" uninstalln "IBMrsctBasMsg-it_IT-ISO8859-1 \ IBMrsctBasMsg-it_IT-ISO8859-15 \ IBMrsctBasMsg-it_IT-UTF-8" uninstalln "IBMrsctBasMsg-ja_JP-eucJP \ IBMrsctBasMsg-ja_JP-UTF-8" uninstalln "IBMrsctBasMsg-ko_KR-EUC \ IBMrsctBasMsg-ko_KR-UTF-8" uninstalln "IBMrsctBasMsg-pt_BR-UTF-8 \ IBMrsctBasMsg-pt_BR-ISO8859-1" uninstalln "IBMrsctBasMsg-zh_CN-GB18030 \ IBMrsctBasMsg-zh_CN-GBK \ IBMrsctBasMsg-zh_CN-UTF-8 \ IBMrsctBasMsg-zh_CN-EUC" uninstalln "IBMrsctBasMsg-zh_TW-BIG5 \ IBMrsctBasMsg-zh_TW-EUC \ IBMrsctBasMsg-zh_TW-UTF-8" fi #======================================================== # >>> uninstall prerequesite package "rsct.basic" # if [ "$OS" = Linux ] ; then uninstalln rsct.basic else # Solaris uninstalln IBMrsctBasic fi RC=$? if [ $RC -ne 0 ] ; then logExit uinstexit $RC_UNINSTALLER_ERROR fi fi # Check if rsct.core.cimrm is installed and skip uninstall of the rest if so. if [ $INSTCIMRM -eq 0 ] ; then # rsct.core.cimrm is NOT installed, can remove rest. # rsct.core msg if [ "$OS" = Linux ] ; then uninstalln "rsct.core.msg.de_DE \ rsct.core.msg.de_DE.ISO-8859-1 \ rsct.core.msg.de_DE@euro \ rsct.core.msg.de_DE.UTF-8" uninstalln "rsct.core.msg.es_ES \ rsct.core.msg.es_ES.ISO-8859-1 \ rsct.core.msg.es_ES@euro \ rsct.core.msg.es_ES.UTF-8" uninstalln "rsct.core.msg.fr_FR \ rsct.core.msg.fr_FR.ISO-8859-1 \ rsct.core.msg.fr_FR@euro \ rsct.core.msg.fr_FR.UTF-8" uninstalln "rsct.core.msg.it_IT \ rsct.core.msg.it_IT.ISO-8859-1 \ rsct.core.msg.it_IT@euro \ rsct.core.msg.it_IT.UTF-8" uninstalln "rsct.core.msg.ja_JP.eucJP \ rsct.core.msg.ja_JP.UTF-8" uninstalln "rsct.core.msg.ko_KR.eucKR \ rsct.core.msg.ko_KR.UTF-8" uninstalln "rsct.core.msg.pt_BR \ rsct.core.msg.pt_BR.UTF-8" uninstalln "rsct.core.msg.zh_CN.GB2312 \ rsct.core.msg.zh_CN.GB18030 \ rsct.core.msg.zh_CN.GBK \ rsct.core.msg.zh_CN.UTF-8" uninstalln "rsct.core.msg.zh_TW \ rsct.core.msg.zh_TW.Big5 \ rsct.core.msg.zh_TW.eucTW \ rsct.core.msg.zh_TW.UTF-8" else # Solaris uninstalln "IBMrsctCorMsg-de_DE-ISO8859-1 \ IBMrsctCorMsg-de_DE-ISO8859-15 \ IBMrsctCorMsg-de_DE-UTF-8" uninstalln "IBMrsctCorMsg-es_ES-ISO8859-1 \ IBMrsctCorMsg-es_ES-ISO8859-15 \ IBMrsctCorMsg-es_ES-UTF-8" uninstalln "IBMrsctCorMsg-fr_FR-ISO8859-1 \ IBMrsctCorMsg-fr_FR-ISO8859-15 \ IBMrsctCorMsg-fr_FR-UTF-8" uninstalln "IBMrsctCorMsg-it_IT-ISO8859-1 \ IBMrsctCorMsg-it_IT-ISO8859-15 \ IBMrsctCorMsg-it_IT-UTF-8" uninstalln "IBMrsctCorMsg-ja_JP-eucJP \ IBMrsctCorMsg-ja_JP-UTF-8" uninstalln "IBMrsctCorMsg-ko_KR-EUC \ IBMrsctCorMsg-ko_KR-UTF-8" uninstalln "IBMrsctCorMsg-pt_BR-UTF-8 \ IBMrsctCorMsg-pt_BR-ISO8859-1" uninstalln "IBMrsctCorMsg-zh_CN-GB18030 \ IBMrsctCorMsg-zh_CN-GBK \ IBMrsctCorMsg-zh_CN-UTF-8 \ IBMrsctCorMsg-zh_CN-EUC" uninstalln "IBMrsctCorMsg-zh_TW-BIG5 \ IBMrsctCorMsg-zh_TW-EUC \ IBMrsctCorMsg-zh_TW-UTF-8" fi #======================================================== # >>> uninstall prerequesite package "rsct.core" # if [ "$OS" = Linux ] ; then uninstalln rsct.core else # Solaris uninstalln IBMrsctCore fi RC=$? if [ $RC -ne 0 ] ; then logExit uinstexit $RC_UNINSTALLER_ERROR fi # rsct.core.utils msg if [ "$OS" = Linux ] ; then uninstalln "rsct.core.utils.msg.de_DE \ rsct.core.utils.msg.de_DE.ISO-8859-1 \ rsct.core.utils.msg.de_DE@euro \ rsct.core.utils.msg.de_DE.UTF-8" uninstalln "rsct.core.utils.msg.es_ES \ rsct.core.utils.msg.es_ES.ISO-8859-1 \ rsct.core.utils.msg.es_ES@euro \ rsct.core.utils.msg.es_ES.UTF-8" uninstalln "rsct.core.utils.msg.fr_FR \ rsct.core.utils.msg.fr_FR.ISO-8859-1 \ rsct.core.utils.msg.fr_FR@euro \ rsct.core.utils.msg.fr_FR.UTF-8" uninstalln "rsct.core.utils.msg.it_IT \ rsct.core.utils.msg.it_IT.ISO-8859-1 \ rsct.core.utils.msg.it_IT@euro \ rsct.core.utils.msg.it_IT.UTF-8" uninstalln "rsct.core.utils.msg.ja_JP.eucJP \ rsct.core.utils.msg.ja_JP.UTF-8" uninstalln "rsct.core.utils.msg.ko_KR.eucKR \ rsct.core.utils.msg.ko_KR.UTF-8" uninstalln "rsct.core.utils.msg.pt_BR \ rsct.core.utils.msg.pt_BR.UTF-8" uninstalln "rsct.core.utils.msg.zh_CN.GB2312 \ rsct.core.utils.msg.zh_CN.GB18030 \ rsct.core.utils.msg.zh_CN.GBK \ rsct.core.utils.msg.zh_CN.UTF-8" uninstalln "rsct.core.utils.msg.zh_TW \ rsct.core.utils.msg.zh_TW.Big5 \ rsct.core.utils.msg.zh_TW.eucTW \ rsct.core.utils.msg.zh_TW.UTF-8" else # Solaris uninstalln "IBMrsctCorUtMsg-de_DE-ISO8859-1 \ IBMrsctCorUtMsg-de_DE-ISO8859-15 \ IBMrsctCorUtMsg-de_DE-UTF-8" uninstalln "IBMrsctCorUtMsg-es_ES-ISO8859-1 \ IBMrsctCorUtMsg-es_ES-ISO8859-15 \ IBMrsctCorUtMsg-es_ES-UTF-8" uninstalln "IBMrsctCorUtMsg-fr_FR-ISO8859-1 \ IBMrsctCorUtMsg-fr_FR-ISO8859-15 \ IBMrsctCorUtMsg-fr_FR-UTF-8" uninstalln "IBMrsctCorUtMsg-it_IT-ISO8859-1 \ IBMrsctCorUtMsg-it_IT-ISO8859-15 \ IBMrsctCorUtMsg-it_IT-UTF-8" uninstalln "IBMrsctCorUtMsg-ja_JP-eucJP \ IBMrsctCorUtMsg-ja_JP-UTF-8" uninstalln "IBMrsctCorUtMsg-ko_KR-EUC \ IBMrsctCorUtMsg-ko_KR-UTF-8" uninstalln "IBMrsctCorUtMsg-pt_BR-UTF-8 \ IBMrsctCorUtMsg-pt_BR-ISO8859-1" uninstalln "IBMrsctCorUtMsg-zh_CN-GB18030 \ IBMrsctCorUtMsg-zh_CN-GBK \ IBMrsctCorUtMsg-zh_CN-UTF-8 \ IBMrsctCorUtMsg-zh_CN-EUC" uninstalln "IBMrsctCorUtMsg-zh_TW-BIG5 \ IBMrsctCorUtMsg-zh_TW-EUC \ IBMrsctCorUtMsg-zh_TW-UTF-8" fi #======================================================== # >>> uninstall prerequesite package "rsct.core.utils" # if [ "$OS" = Linux ] ; then uninstalln rsct.core.utils else # Solaris uninstalln IBMrsctCoreUtils fi RC=$? if [ $RC -ne 0 ] ; then logExit uinstexit $RC_UNINSTALLER_ERROR fi # src msgs if [ "$OS" = Linux ] ; then uninstalln "src.msg.de_DE \ src.msg.de_DE.ISO-8859-1 \ src.msg.de_DE@euro \ src.msg.de_DE.UTF-8" uninstalln "src.msg.es_ES \ src.msg.es_ES.ISO-8859-1 \ src.msg.es_ES@euro \ src.msg.es_ES.UTF-8" uninstalln "src.msg.fr_FR \ src.msg.fr_FR.ISO-8859-1 \ src.msg.fr_FR@euro \ src.msg.fr_FR.UTF-8" uninstalln "src.msg.it_IT \ src.msg.it_IT.ISO-8859-1 \ src.msg.it_IT@euro \ src.msg.it_IT.UTF-8" uninstalln "src.msg.ja_JP.eucJP \ src.msg.ja_JP.UTF-8" uninstalln "src.msg.ko_KR.eucKR \ src.msg.ko_KR.UTF-8" uninstalln "src.msg.pt_BR \ src.msg.pt_BR.UTF-8" uninstalln "src.msg.zh_CN.GB2312 \ src.msg.zh_CN.GB18030 \ src.msg.zh_CN.GBK \ src.msg.zh_CN.UTF-8" uninstalln "src.msg.zh_TW \ src.msg.zh_TW.Big5 \ src.msg.zh_TW.eucTW \ src.msg.zh_TW.UTF-8" else # Solaris uninstalln "IBMsrcMsg-de_DE-ISO8859-1 \ IBMsrcMsg-de_DE-ISO8859-15 \ IBMsrcMsg-de_DE-UTF-8" uninstalln "IBMsrcMsg-es_ES-ISO8859-1 \ IBMsrcMsg-es_ES-ISO8859-15 \ IBMsrcMsg-es_ES-UTF-8" uninstalln "IBMsrcMsg-fr_FR-ISO8859-1 \ IBMsrcMsg-fr_FR-ISO8859-15 \ IBMsrcMsg-fr_FR-UTF-8" uninstalln "IBMsrcMsg-it_IT-ISO8859-1 \ IBMsrcMsg-it_IT-ISO8859-15 \ IBMsrcMsg-it_IT-UTF-8" uninstalln "IBMsrcMsg-ja_JP-eucJP \ IBMsrcMsg-ja_JP-UTF-8" uninstalln "IBMsrcMsg-ko_KR-EUC \ IBMsrcMsg-ko_KR-UTF-8" uninstalln "IBMsrcMsg-pt_BR-UTF-8 \ IBMsrcMsg-pt_BR-ISO8859-1" uninstalln "IBMsrcMsg-zh_CN-GB18030 \ IBMsrcMsg-zh_CN-GBK \ IBMsrcMsg-zh_CN-UTF-8 \ IBMsrcMsg-zh_CN-EUC" uninstalln "IBMsrcMsg-zh_TW-BIG5 \ IBMsrcMsg-zh_TW-EUC \ IBMsrcMsg-zh_TW-UTF-8" fi #======================================================== # >>> uninstall prerequesite package "src" # if [ "$OS" = Linux ] ;then uninstalln src else # Solaris uninstalln IBMsrc fi RC=$? if [ $RC -ne 0 ] ; then logExit uinstexit $RC_UNINSTALLER_ERROR fi fi fi # c002 if [ $RC -eq 0 ] ; then # Check if sapolicies/db2 subdirectory exists # and remove it if [ -d "$DB2_POLICIES_DIR" ] ; then rm -rf "$DB2_POLICIES_DIR" >/dev/null 2>&1 # if sam.policies package is not installed # also remove directory sapolicies RCX=0 case "$OS" in Linux) rpm -q sam.policies >/dev/null 2>&1 RCX=$? ;; SunOS) pkginfo -x IBMsamPolicies >/dev/null 2>&1 RCX=$? ;; AIX) lslpp -l sam.policies >/dev/null 2>&1 RCX=$? ;; esac if [ $RCX -ne 0 ] ; then # seems like sam.policies is not installed # can remove directory sapolicies rmdir "$POLICIES_DIR" >/dev/null 2>&1 if [ $LINUX_OR_SOLARIS -eq 1 ] ; then # can remove rsct dir rmdir "$RSCT_DIR" >/dev/null 2>&1 fi fi fi fi #======================================================== # display packages if any left # Check what was left installed SHOW_INST=0 case "$OS" in Linux) DONE=`rpm -qa|grep -E "^src-|^src\.|^rsct|^sam-|^sam\."|sort` if [ -n "$DONE" ] ; then SHOW_INST=1 fi ;; SunOS) DONE=`pkginfo -x | /usr/xpg4/bin/grep -E "^src-|^src|^rsct-|^sam-|^sam" | awk '{print $1}' | sort` if [ -n "$DONE" ] ; then SHOW_INST=1 fi JUNK=rmvPkgAdminFile ;; AIX) DONE=`lslpp -l "sam*" 2>/dev/null |grep -E "^sam-|^sam\."|sort` RC=$? if [ $RC -eq 0 ] && [ -n "$DONE" ] ; then SHOW_INST=1 fi ;; esac # Show what was left installed if [ $SHOW_INST -eq 1 ] ; then logit "$U03" for DONE1 in $DONE do logit " $DONE1" done fi UINST_RC=0 # check for errors if [ $ERROR -eq 1 ] ; then UINST_RC=$RC_UNINSTALLER_ERROR logit "$U11" if [ -n "$FIRST_ERROR" ] ; then # logs installer error return code logit "$FIRST_ERROR" fi if [ -r "$TMP_FIRST_STDERR" ] ; then if [ $OPT_SILENT -eq 0 ] ; then cat $TMP_FIRST_STDERR fi cat $TMP_FIRST_STDERR >> $UINST_LOG logit "" fi if [ -r "$TMP_FIRST_STDOUT" ] ; then if [ $OPT_SILENT -eq 0 ] ; then cat $TMP_FIRST_STDOUT fi cat $TMP_FIRST_STDOUT >> $UINST_LOG logit "" fi fi if [ $ANY_UINST -eq 0 ] ; then logit "$U13" fi if [ -z "$FIRST_ERROR" ] ; then # uninstallSAM was successful, # start removal of uninstallSAMx script and remove uninstall directory startRemoveMe fi uinstexit $UINST_RC