# # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" # # Removal class action script for ipsecalgs class files. # # This script removes entries belonging to the package from the # /etc/inet/ipsecalgs file. # pkg_start="# Start $PKGINST" pkg_end="# End $PKGINST" confile=/etc/inet/ipsecalgs tmpfile=/tmp/$$ipsecalgs error=no while read dest do # Strip all entries belonging to this package grep "$pkg_start" $dest > /dev/null if [ $? -eq 0 ] then sed -e "/$pkg_start/,/$pkg_end/d" $dest > $tmpfile || error=yes if [ "$error" = no ] then mv $tmpfile $dest || error=yes fi rm -f $tmpfile else echo "$0: WARNING - no entries to be removed from the $confile file" exit 0 fi done if [ "$error" = yes ] then echo "$0: ERROR - failed to update the $confile file." exit 2 fi exit 0