#!/bin/ksh #******************************************************************************* # # NAME: preinstall # SUMMARY: %description% # COMPONENT: SUNWuser # VERSION: 1 # UPDATE DATE: %date_modified: Fri Jul 25 08:48:40 1997 % # PROGRAMMER: %created_by: bmyers % # # Copyright 1997 by Symbios Logic Inc. # # DESCRIPTION: Remove files obsolete in Release 6.01 # # # NOTES: # # # REFERENCE: # 1. PIP0003C.DOC, Source Code Integrity Measures # # # CODING STANDARD WAIVERS: # # #******************************************************************************* # When this preinstall script executes, the package database already has # knowledge of this installation attempt. Therefore we must determine if the # package is indeed this attempt or a previous version. If it is this attempt, # we will proceed with the installation. PACKAGE=`pkginfo -l | grep SUNWosau | cut -d: -f2` PREVIOUSVERSION=`pkgparam SUNWosau VSTOCK` if [ "$PREVIOUSVERSION" = "$VSTOCK" ]; then # proceed with the install of this package exit 0 fi # Do not allow pkgadd of the current package if previous SUNWosa package(s) exist # unless we are root/boot. If the array is the boot device and we remove the old # packges, we will not be able to reboot. In this case we must remove obsolete files. if pkginfo | grep SUNWosau >/dev/null 2>&1 then if grep rootdev /etc/system | grep -v "^*" | grep rdriver >/dev/null 2>&1 then break; else echo echo " *** WARNING ***" echo echo " A previous instance of SUNWosar and/or SUNWosau is installed on this" echo " system. Please remove the package(s) using the pkgrm utility, then" echo " execute pkgadd of $PKGINST again." echo echo " Aborting pkgadd of $PKGINST" echo exit 1 fi fi if [ -f $BASEDIR/lib/osa/bin/rm6cfgap ] then removef SUNWosau $BASEDIR/lib/osa/bin/rm6cfgap 2>/dev/null rm $BASEDIR/lib/osa/bin/rm6cfgap 2>/dev/null fi if [ -f $BASEDIR/lib/osa/bin/rm6rec ] then removef SUNWosau $BASEDIR/lib/osa/bin/rm6rec 2>/dev/null rm $BASEDIR/lib/osa/bin/rm6rec 2>/dev/null fi if [ -f $BASEDIR/lib/osa/bin/rm6stat ] then removef SUNWosau $BASEDIR/lib/osa/bin/rm6stat 2>/dev/null rm $BASEDIR/lib/osa/bin/rm6stat 2>/dev/null fi if [ -f $BASEDIR/lib/osa/help/helpcfg.txt ] then removef SUNWosau $BASEDIR/lib/osa/help/helpcfg.txt 2>/dev/null rm $BASEDIR/lib/osa/help/helpcfg.txt 2>/dev/null fi if [ -f $BASEDIR/lib/osa/help/helpmnt.txt ] then removef SUNWosau $BASEDIR/lib/osa/help/helpmnt.txt 2>/dev/null rm $BASEDIR/lib/osa/help/helpmnt.txt 2>/dev/null fi if [ -f $BASEDIR/lib/osa/help/helprecv.txt ] then removef SUNWosau $BASEDIR/lib/osa/help/helprecv.txt 2>/dev/null rm $BASEDIR/lib/osa/help/helprecv.txt 2>/dev/null fi if [ -f $BASEDIR/lib/osa/help/helpstat.txt ] then removef SUNWosau $BASEDIR/lib/osa/help/helpstat.txt 2>/dev/null rm $BASEDIR/lib/osa/help/helpstat.txt 2>/dev/null fi # Problem 2953 - Task 2246 # Remove real files but not links if [ -f $BASEDIR/sbin/osa/drivutil ] then if [ ! -h $BASEDIR/sbin/osa/drivutil ] then removef SUNWosau $BASEDIR/sbin/osa/drivutil 2>/dev/null rm $BASEDIR/sbin/osa/drivutil 2>/dev/null fi fi if [ -f $BASEDIR/sbin/osa/fwutil ] then if [ ! -h $BASEDIR/sbin/osa/fwutil ] then removef SUNWosau $BASEDIR/sbin/osa/fwutil 2>/dev/null rm $BASEDIR/sbin/osa/fwutil 2>/dev/null fi fi if [ -f $BASEDIR/sbin/osa/healthck ] then if [ ! -h $BASEDIR/sbin/osa/healthck ] then removef SUNWosau $BASEDIR/sbin/osa/healthck 2>/dev/null rm $BASEDIR/sbin/osa/healthck 2>/dev/null fi fi if [ -f $BASEDIR/sbin/osa/lad ] then if [ ! -h $BASEDIR/sbin/osa/lad ] then removef SUNWosau $BASEDIR/sbin/osa/lad 2>/dev/null rm $BASEDIR/sbin/osa/lad 2>/dev/null fi fi if [ -f $BASEDIR/sbin/osa/nvutil ] then if [ ! -h $BASEDIR/sbin/osa/nvutil ] then removef SUNWosau $BASEDIR/sbin/osa/nvutil 2>/dev/null rm $BASEDIR/sbin/osa/nvutil 2>/dev/null fi fi if [ -f $BASEDIR/sbin/osa/parityck ] then if [ ! -h $BASEDIR/sbin/osa/parityck ] then removef SUNWosau $BASEDIR/sbin/osa/parityck 2>/dev/null rm $BASEDIR/sbin/osa/parityck 2>/dev/null fi fi if [ -f $BASEDIR/sbin/osa/raidutil ] then if [ ! -h $BASEDIR/sbin/osa/raidutil ] then removef SUNWosau $BASEDIR/sbin/osa/raidutil 2>/dev/null rm $BASEDIR/sbin/osa/raidutil 2>/dev/null fi fi if [ -f $BASEDIR/sbin/osa/rdacutil ] then if [ ! -h $BASEDIR/sbin/osa/rdacutil ] then removef SUNWosau $BASEDIR/sbin/osa/rdacutil 2>/dev/null rm $BASEDIR/sbin/osa/rdacutil 2>/dev/null fi fi if [ -f $BASEDIR/sbin/osa/rm6 ] then if [ ! -h $BASEDIR/sbin/osa/rm6 ] then removef SUNWosau $BASEDIR/sbin/osa/rm6 2>/dev/null rm $BASEDIR/sbin/osa/rm6 2>/dev/null fi fi # Problem 2953 - Task 2246 # Remove links if [ -h $BASEDIR/lib/osa/bin/rm6 ] then removef SUNWosau $BASEDIR/lib/osa/bin/rm6 2>/dev/null rm $BASEDIR/lib/osa/bin/rm6 2>/dev/null fi if [ -h $BASEDIR/lib/osa/bin/lad ] then removef SUNWosau $BASEDIR/lib/osa/bin/lad 2>/dev/null rm $BASEDIR/lib/osa/bin/lad 2>/dev/null fi if [ -h $BASEDIR/lib/osa/bin/nvutil ] then removef SUNWosau $BASEDIR/lib/osa/bin/nvutil 2>/dev/null rm $BASEDIR/lib/osa/bin/nvutil 2>/dev/null fi if [ -h $BASEDIR/lib/osa/bin/raidutil ] then removef SUNWosau $BASEDIR/lib/osa/bin/raidutil 2>/dev/null rm $BASEDIR/lib/osa/bin/raidutil 2>/dev/null fi removef -f SUNWosau exit 0