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