1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# Use is subject to license terms.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# CDDL HEADER START
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# The contents of this file are subject to the terms of the
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# Common Development and Distribution License, Version 1.0 only
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# (the "License"). You may not use this file except in compliance
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# with the License.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# See the License for the specific language governing permissions
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# and limitations under the License.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# When distributing Covered Code, include this CDDL HEADER in each
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# If applicable, add the following below this CDDL HEADER, with the
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# fields enclosed by brackets "[]" replaced with your own identifying
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# CDDL HEADER END
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# ident "%Z%%M% %I% %E% SMI"
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# Removal class action script for ipsecalgs class files.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# This script removes entries belonging to the package from the
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsyncpkg_start="# Start $PKGINST"
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsyncpkg_end="# End $PKGINST"
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsynctmpfile=/tmp/$$ipsecalgs
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsyncwhile read dest
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync # Strip all entries belonging to this package
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync grep "$pkg_start" $dest > /dev/null
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync if [ $? -eq 0 ]
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync sed -e "/$pkg_start/,/$pkg_end/d" $dest > $tmpfile || error=yes
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync if [ "$error" = no ]
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync mv $tmpfile $dest || error=yes
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync rm -f $tmpfile
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync echo "$0: WARNING - no entries to be removed from the $confile file"
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsyncif [ "$error" = yes ]
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync echo "$0: ERROR - failed to update the $confile file."