home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / encrypt / install / preremove < prev    next >
Encoding:
Text File  |  1998-08-19  |  2.0 KB  |  72 lines

  1. #!/bin/sh
  2. #
  3. #       @(#) preremove.shinc 12.3 97/11/17 
  4. #
  5. # Copyright (c) 1997 The Santa Cruz Operation, Inc.. All Rights Reserved.
  6. # THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE SANTA CRUZ OPERATION INC.
  7. # The copyright notice above does not evidence any actual or intended
  8. # publication of such source code.
  9. ME="`basename $0`"
  10. ISL_FILE="/etc/inst/scripts/postreboot.sh"
  11. SUCCESS=0; FAIL=1; INTR=3
  12. trap "exit $INTR" 2 3 15
  13.  
  14. # location of the packaging information files during this phase of installation
  15. INSTALL_DIR="/var/sadm/pkg/$PKGINST/install/$PKGINST"
  16.  
  17. # string to identify Strong Encryption license lines in nodelock files
  18. NODELOCK_FILE="/var/netls/nodelock"
  19. NODELOCK_BAK_FILE="/var/netls/nodelock.bak"
  20. LICENSESTRING="i1705/|p1705/"
  21.  
  22.  
  23. ##########################################################################
  24. #
  25. # rm_ses_license
  26. #
  27. # remove the Strong Encryption license from the nodelock file
  28. #
  29. ##########################################################################
  30. rm_ses_license()
  31. {
  32.     # take a backup of the nodelock file, just in case
  33.     cp $NODELOCK_FILE $NODELOCK_BAK_FILE
  34.  
  35.     # transfer only lines that don't define Strong Encryption licenses
  36.     egrep -v "$LICENSESTRING" $NODELOCK_FILE >/tmp/_ccs$$ 2>/dev/null
  37.     cp /tmp/_ccs$$ $NODELOCK_FILE
  38.     rm -f /tmp/_ccs$$
  39.  
  40.     # signal changes to the PMD
  41.     if [ -f /pmd/ifor_pmd.pid ]; then
  42.         pid=`head -1 /pmd/ifor_pmd.pid 2>/dev/null | \
  43.                 awk '{ print $1 }' 2>/dev/null`
  44.         if [ -n "$pid" ]; then
  45.             kill -1 $pid >/dev/null 2>&1
  46.         fi
  47.     fi
  48. }
  49.  
  50.  
  51. ##########################################################################
  52. #
  53. # main
  54. #
  55. ##########################################################################
  56.  
  57. # remove the Strong Encryption license from the system
  58. rm_ses_license
  59.  
  60. # now run encrypt_config to reset the links for all of the packages
  61. # that removing the strong encryption license affects
  62. if [ -x /usr/sbin/encrypt_config ]; then
  63.     /usr/sbin/encrypt_config
  64. else
  65.     echo "$ME: can't find or run /usr/sbin/encrypt_config" >&2
  66.     exit $FAIL
  67. fi
  68.  
  69. # done
  70. exit $SUCCESS
  71.