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

  1. #ident    "@(#)preremove    1.2"
  2. #ident  "$Header: $"
  3.  
  4. PKGMSG=${PKGINST}.pkg
  5.  
  6. LOCALE=${LC_ALL:-${LC_MESSAGES:-${LANG:-"C"}}}
  7.  
  8. savemv()
  9. {
  10.     trap "" 1 2 3 15
  11.     mv -f $1 $2 > /dev/null 2>&1
  12.     if [ $? -ne 0 ]; then
  13.         pfmt -s error -g ${PKGMSG}:4 "Unable to create %s\n" $2
  14.     fi
  15.     trap 1 2 3 15
  16. }
  17.  
  18. if [ ! -f /usr/lib/locale/${LOCALE}/LC_MESSAGES/${PKGMSG} ]
  19. then
  20.    if [ -f ${REQDIR}/inst/locale/${LOCALE}/${PKGMSG} -a \
  21.     -d /usr/lib/locale/${LOCALE}/LC_MESSAGES ]
  22.    then
  23.     cp ${REQDIR}/inst/locale/${LOCALE}/${PKGMSG} \
  24.        /usr/lib/locale/${LOCALE}/LC_MESSAGES
  25.    fi
  26. fi
  27. #
  28. # shut NIS down
  29. #
  30. if [ -f /etc/init.d/nis ]; then
  31.     sh /etc/init.d/nis stop
  32. fi
  33.  
  34. #
  35. # remove tcpip_nis.so from /etc/netconfig
  36. #
  37. grep tcpip_nis /etc/netconfig > /dev/null 2>&1
  38. if [ $? = 0 ]; then
  39.         ed - /etc/netconfig << EOF > /dev/null 2>&1
  40. g/\/usr\/lib\/tcpip_nis\.so\,/s///g
  41. g/\,*\/usr\/lib\/tcpip_nis\.so/s///g
  42. w
  43. q
  44. EOF
  45. fi
  46.  
  47.  
  48. /usr/bin/rm -rf /usr/lib/ns.so
  49. /usr/bin/rm -rf /usr/lib/ns.so.1
  50.  
  51. if [ -d /var/yp/binding ]; then
  52.     rm -rf /var/yp/binding/*
  53. fi
  54.  
  55. rm -rf /var/yp/*.time /var/yp/*.log
  56. rm -rf /var/yp/aliases
  57. rm -rf /var/yp/Makefile
  58. rm -rf /var/yp/YPMAPS
  59. rm -rf /var/yp/update*
  60.  
  61. d=`domainname`
  62. if [ -n "$d" ]; then
  63.     if [ -d /var/yp/$d ]; then
  64.         rm -rf /var/yp/$d
  65.     fi
  66. fi
  67.