#!/bin/sh
##
##  File:  preinstall
##
##  Description:  preinstall script for SUNWscrdt installation.
##                This script is run before the package is installed
#
# ident	"@(#)preinstall	1.1	01/11/15 SMI"
#
# Copyright (c) 2001, by Sun Microsystems, Inc.
# All rights reserved.
#

REM_DRV=/usr/sbin/rem_drv
RM=/bin/rm
DEVDIR=/dev
RDT_MODULE=rsmrdt
RDTDEV=/devices/pseudo/rsmrdt@0:rsmrdt

#
# remove the driver if it is already there
#

if [ ! -x $REM_DRV ] ; then
    echo "Cannot find $REM_DRV, aborting..."
    exit 1
fi

if [ -c $RDTDEV ] ; then
    echo "removing existing rsmrdt driver from the system."
    $REM_DRV $RDT_MODULE
fi

#
# remove the symbolic link if it is there
#

if [ -f $DEVDIR/$RDT_MODULE ] ; then
    echo "removing symbolic link $DEVDIR/$RDT_MODULE"
    $RM -f $DEVDIR/$RDT_MODULE
fi


exit 0

## EOF
