home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #
- # @(#) preremove.shinc 12.3 97/11/17
- #
- # Copyright (c) 1997 The Santa Cruz Operation, Inc.. All Rights Reserved.
- # THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE SANTA CRUZ OPERATION INC.
- # The copyright notice above does not evidence any actual or intended
- # publication of such source code.
- #
- ME="`basename $0`"
- ISL_FILE="/etc/inst/scripts/postreboot.sh"
- SUCCESS=0; FAIL=1; INTR=3
- trap "exit $INTR" 2 3 15
-
- # location of the packaging information files during this phase of installation
- INSTALL_DIR="/var/sadm/pkg/$PKGINST/install/$PKGINST"
-
- # string to identify Strong Encryption license lines in nodelock files
- NODELOCK_FILE="/var/netls/nodelock"
- NODELOCK_BAK_FILE="/var/netls/nodelock.bak"
- LICENSESTRING="i1705/|p1705/"
-
-
- ##########################################################################
- #
- # rm_ses_license
- #
- # remove the Strong Encryption license from the nodelock file
- #
- ##########################################################################
- rm_ses_license()
- {
- # take a backup of the nodelock file, just in case
- cp $NODELOCK_FILE $NODELOCK_BAK_FILE
-
- # transfer only lines that don't define Strong Encryption licenses
- egrep -v "$LICENSESTRING" $NODELOCK_FILE >/tmp/_ccs$$ 2>/dev/null
- cp /tmp/_ccs$$ $NODELOCK_FILE
- rm -f /tmp/_ccs$$
-
- # signal changes to the PMD
- if [ -f /pmd/ifor_pmd.pid ]; then
- pid=`head -1 /pmd/ifor_pmd.pid 2>/dev/null | \
- awk '{ print $1 }' 2>/dev/null`
- if [ -n "$pid" ]; then
- kill -1 $pid >/dev/null 2>&1
- fi
- fi
- }
-
-
- ##########################################################################
- #
- # main
- #
- ##########################################################################
-
- # remove the Strong Encryption license from the system
- rm_ses_license
-
- # now run encrypt_config to reset the links for all of the packages
- # that removing the strong encryption license affects
- if [ -x /usr/sbin/encrypt_config ]; then
- /usr/sbin/encrypt_config
- else
- echo "$ME: can't find or run /usr/sbin/encrypt_config" >&2
- exit $FAIL
- fi
-
- # done
- exit $SUCCESS
-