2 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
3 # Use is subject to license terms.
7 # The contents of this file are subject to the terms of the
8 # Common Development and Distribution License (the "License").
9 # You may not use this file except in compliance with the License.
11 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
12 # or http://www.opensolaris.org/os/licensing.
13 # See the License for the specific language governing permissions
14 # and limitations under the License.
16 # When distributing Covered Code, include this CDDL HEADER in each
17 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
18 # If applicable, add the following below this CDDL HEADER, with the
19 # fields enclosed by brackets "[]" replaced with your own identifying
20 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # ident "%Z%%M% %I% %E% SMI"
26 # Removal class action script for "kmfconf" class files.
28 # This script removes entries belonging to the package from the
29 # /etc/crypto/kmf.conf file.
32 pkg_start="# Start $PKGINST"
33 pkg_end="# End $PKGINST"
34 tmpfile=/tmp/$$kmfconf
39 # For multiple input files; exit if error occurred in preious
43 echo "$0: failed to update $lastdest for $PKGINST."
48 # Strip all entries belonging to this package
51 egrep -s "$pkg_start" $dest && start=1
52 egrep -s "$pkg_end" $dest && end=1
54 if [ $start -ne $end ] ; then
55 echo "$0: missing Start or End delimiters for $PKGINST in \
57 echo "$0: $dest may be corrupted and was not updated."
64 sed -e "/$pkg_start/,/$pkg_end/d" $dest > $tmpfile || error=yes
67 mv $tmpfile $dest || error=yes
71 echo "$0: WARNING - no entries found in $dest for $PKGINST."
78 echo "$0: ERROR - failed to update $lastdest for $PKGINST."