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