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