preremove revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
0N/A#!/bin/sh
0N/A#
0N/A# CDDL HEADER START
631N/A#
0N/A# The contents of this file are subject to the terms of the
0N/A# Common Development and Distribution License (the "License").
0N/A# You may not use this file except in compliance with the License.
0N/A#
292N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
292N/A# or http://www.opensolaris.org/os/licensing.
292N/A# See the License for the specific language governing permissions
292N/A# and limitations under the License.
0N/A#
0N/A# When distributing Covered Code, include this CDDL HEADER in each
0N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
292N/A# If applicable, add the following below this CDDL HEADER, with the
292N/A# fields enclosed by brackets "[]" replaced with your own identifying
292N/A# information: Portions Copyright [yyyy] [name of copyright owner]
292N/A#
292N/A# CDDL HEADER END
292N/A#
292N/A#
292N/A# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
292N/A# Use is subject to license terms.
292N/A#
292N/A#
0N/A
0N/APATH="/usr/bin:/usr/sbin:${PATH}"; export PATH
0N/A
0N/ASERVICE="svc:/network/npiv_config:default"
0N/A
0N/A#
0N/A# The following case implies that the installation was not on the root disk
0N/A#
0N/Aif [ "${PKG_INSTALL_ROOT}" != "" -a "${PKG_INSTALL_ROOT}" != "/" ]; then
0N/A #
0N/A # Do not disable the service in this case.
0N/A #
0N/A exit 0
0N/Afi
0N/A
0N/A#
0N/A# Confirm service is installed, otherwise exit.
510N/A#
0N/A/usr/bin/svcprop -q ${SERVICE} || exit 0
0N/A
0N/ASVCPROP=`svcprop -p general/enabled ${SERVICE}`
0N/A
0N/A#
0N/A# Check to see if the service is running and if so disable it.
0N/A#
0N/Aif [ "${SVCPROP}" = "true" ]; then
0N/A svcadm disable ${SERVICE}
0N/A if [ $? -ne 0 ]; then
18N/A echo "\n$0 Disabling of ${SERVICE} failed!\n" >&2
18N/A exit 1
18N/A fi
18N/A svcadm refresh ${SERVICE}
18N/Afi
18N/Aexit 0
18N/A