r.manifest revision 7082
7082N/A#!/bin/sh
7082N/A#
7082N/A# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
7082N/A# Use is subject to license terms.
7082N/A#
7082N/A#ident "@(#)r.manifest 1.2 04/09/24 SMI"
7082N/A#
7082N/A# r.manifest - smf(5) manifest remove class action script
7082N/A#
7082N/A
7082N/Aif [ "$PKG_INSTALL_ROOT" != "" -a "$PKG_INSTALL_ROOT" != "/" ]; then
7082N/A #
7082N/A # We can't safely disable the service in this case.
7082N/A #
7082N/A smf_alive=no
7082N/Aelse
7082N/A #
7082N/A # We can verify if the service is disabled prior to
7082N/A # removal.
7082N/A #
7082N/A if [ -r /etc/svc/volatile/repository_door ]; then
7082N/A smf_alive=yes
7082N/A fi
7082N/Afi
7082N/A
7082N/ASVCPROP=/usr/bin/svcprop
7082N/A
7082N/Awhile read mfst; do
7082N/A if [ "$smf_alive" = "yes" ]; then
7082N/A ENTITIES=`/usr/sbin/svccfg inventory $mfst`
7082N/A
7082N/A for fmri in $ENTITIES; do
7082N/A #
7082N/A # Determine whether any of our instances are
7082N/A # enabled.
7082N/A #
7082N/A en_p=`$SVCPROP -p general/enabled $fmri 2>/dev/null`
7082N/A en_o=`$SVCPROP -p general_ovr/enabled $fmri 2>/dev/null`
7082N/A
7082N/A if [ "$en_p" = "true" -o "$en_o" = "true" ]; then
7082N/A echo "$fmri remains enabled; aborting"
7082N/A exit 1
7082N/A fi
7082N/A
7082N/A /usr/sbin/svccfg delete $fmri
7082N/A done
7082N/A fi
7082N/A
7082N/A /usr/bin/rm $mfst
7082N/Adone
7082N/A
7082N/Aexit 0