2 # Copyright 2005 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, Version 1.0 only
9 # (the "License"). You may not use this file except in compliance
12 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
13 # or http://www.opensolaris.org/os/licensing.
14 # See the License for the specific language governing permissions
15 # and limitations under the License.
17 # When distributing Covered Code, include this CDDL HEADER in each
18 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
19 # If applicable, add the following below this CDDL HEADER, with the
20 # fields enclosed by brackets "[]" replaced with your own identifying
21 # information: Portions Copyright [yyyy] [name of copyright owner]
25 # ident "%Z%%M% %I% %E% SMI"
27 # Removal class action script for "pkcs11conf" class files.
29 # This script removes entries belonging to the package from the
30 # /etc/crypto/pkcs11.conf file.
33 pkg_start="# Start $PKGINST"
34 pkg_end="# End $PKGINST"
35 tmpfile=/tmp/$$pkcs11conf
40 # For multiple input files; exit if error occurred in preious
44 echo "$0: failed to update $lastdest for $PKGINST."
49 # Strip all entries belonging to this package
52 egrep -s "$pkg_start" $dest && start=1
53 egrep -s "$pkg_end" $dest && end=1
55 if [ $start -ne $end ] ; then
56 echo "$0: missing Start or End delimiters for $PKGINST in \
58 echo "$0: $dest may be corrupted and was not updated."
65 sed -e "/$pkg_start/,/$pkg_end/d" $dest > $tmpfile || error=yes
68 mv $tmpfile $dest || error=yes
72 echo "$0: WARNING - no entries found in $dest for $PKGINST."
79 echo "$0: ERROR - failed to update $lastdest for $PKGINST."