postremove revision 8a57cef6afbd3163c64efedaa20cbfab2c46b9cd
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen#! /usr/bin/sh
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen#
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# CDDL HEADER START
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen#
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# The contents of this file are subject to the terms of the
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# Common Development and Distribution License (the "License").
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# You may not use this file except in compliance with the License.
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen#
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# or http://www.opensolaris.org/os/licensing.
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# See the License for the specific language governing permissions
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# and limitations under the License.
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen#
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# When distributing Covered Code, include this CDDL HEADER in each
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# If applicable, add the following below this CDDL HEADER, with the
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# fields enclosed by brackets "[]" replaced with your own identifying
6cf18519f0804755385871d84384834465b2d68eTimo Sirainen# information: Portions Copyright [yyyy] [name of copyright owner]
6cf18519f0804755385871d84384834465b2d68eTimo Sirainen#
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# CDDL HEADER END
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen#
6cf18519f0804755385871d84384834465b2d68eTimo Sirainen
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen#
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
6cf18519f0804755385871d84384834465b2d68eTimo Sirainen# Use is subject to license terms.
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen#
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo SirainenDRV=arn
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo SirainenBASEDIR=${BASEDIR:-/}
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# Select the correct rem_drv options to execute.
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen# Only attempt to unload the driver on a running system
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainenif [ "$BASEDIR" = "/" ]; then
ed336ce8060d7dc1e452ecb0bbe923ece25c3aa8Timo Sirainen REM_DRV="rem_drv"
else
REM_DRV="rem_drv -b ${BASEDIR}"
fi
# Make sure rem_drv has not been previously executed
# before attempting to remove the driver
/usr/bin/egrep -s "^${DRV}[ ]" $BASEDIR/etc/name_to_major
if [ $? -eq 0 ]; then
${REM_DRV} ${DRV}
if [ $? -ne 0 ]; then
echo "Failed rem_drv ${DRV}!\n" >&2
exit 1
fi
fi
exit 0