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

  1. #ident        "@(#)preremove    1.21"
  2. #ident    "$Header: $"
  3.  
  4. PKGMSG=${PKGINST}.pkg
  5. LOCALE=${LC_ALL:-${LC_MESSAGES:-${LANG:-"C"}}}
  6.  
  7. if [ ! -f /usr/lib/locale/${LOCALE}/LC_MESSAGES/${PKGMSG} ]
  8. then
  9.    if [ -f ${REQDIR}/inst/locale/${LOCALE}/${PKGMSG} -a \
  10.     -d /usr/lib/locale/${LOCALE}/LC_MESSAGES ]
  11.    then
  12.     cp ${REQDIR}/inst/locale/${LOCALE}/${PKGMSG} \
  13.        /usr/lib/locale/${LOCALE}/LC_MESSAGES
  14.    fi
  15. fi
  16. #    
  17. #    STREAMware TCP
  18. #    Copyright 1987, 1993 Lachman Technology, Inc.
  19. #    All Rights Reserved.
  20. #    
  21. #
  22. # Issue a warning message if inet is running.
  23. #
  24. TMP=/tmp/tcp.err
  25. ERROR1=`pfmt -s nostd -g ${PKGMSG}:101 "An error was encountered removing the %s package. The file %s contains errors reported by the system." ${NAME} ${TMP} 2>&1`
  26. ERROR2=`pfmt -s nostd -g ${PKGMSG}:102 "The kernel rebuild failed.  However all software dealing with the %s package has been removed." ${NAME} 2>&1`
  27.  
  28. if [ ! -z "`ps -ef | grep slink | grep -v grep`" ]
  29. then
  30.     pfmt -s warn -g ${PKGMSG}:103 " inet (slink) is still running.\n" 2>&1
  31.  
  32. fi
  33.  
  34. #
  35. # remove the "/dev/inet    MF" entry from /etc/ttysrch.
  36. #
  37. grep -v "/dev/inet    MF" /etc/ttysrch >/tmp/$$.a1
  38. cp /tmp/$$.a1 /etc/ttysrch
  39. rm -f /tmp/$$.a1
  40.  
  41. #
  42. # remove the "/dev/_tcp" entry from vfstab.
  43. #
  44. grep -v "/dev/_tcp" /etc/vfstab >/tmp/$$.a1
  45. cp /tmp/$$.a1 /etc/vfstab
  46. rm -f /tmp/$$.a1
  47.  
  48. # unconfigure inet protocols for multiple boards.
  49. /etc/confnet.d/configure -r -pinet
  50.  
  51. #
  52. # Deinstall INET
  53. #
  54. for MODULE in arp icmp igmp incf inet ip ipip llcloop rip route slip tcp udp 
  55. do
  56.     /etc/conf/bin/idcheck -p ${MODULE} 2> /dev/null
  57.     RES="$?"
  58.     if [ "${RES}" -ne "100" -a "${RES}" -ne "0" ]
  59.     then
  60.         /etc/conf/bin/idinstall -P ${PKGINST} -d ${MODULE} 2>> $TMP
  61.         if [ $? != 0 ]
  62.         then
  63.             message $ERROR1
  64.             exit 1
  65.         fi
  66.         REBUILD=1
  67.     fi
  68. done
  69.  
  70.  
  71. #remove entries added to the device database
  72. for DEVICE in arp icmp igmp incf ip ipip llcloop rip tcp udp tcp_subdev
  73. do
  74.     # Error may only indicate we are not running an ES system
  75.     # or entry does not exist.
  76.     MSG="`putdev -d ${DEVICE} 2>&1`"
  77.     RETURN=$?
  78.     if    [ "$RETURN" = 1 -o "$RETURN" = 2 -o "$RETURN" = 5 ]
  79.         # there's a fatal error that will affect the other devices, too.
  80.         # so print error and abort the loop
  81.     then    pfmt -s nostd -g ${PKGMSG}:104 "Device Database Error %s when deleting %s\n" $RETURN $DEVICE 2>&1
  82.         echo $MSG
  83.         break
  84.     elif    [ "$RETURN" != 0 -a "$RETURN" != 3 ]
  85.         # return 0: everything worked.
  86.         # return 3: entry was not there to delete
  87.         #when none of the above, error gets printed and we loop
  88.     then    pfmt -s nostd -g ${PKGMSG}:104 "Device Database Error %s when deleting %s\n" $RETURN $DEVICE 2>&1
  89.         echo $MSG
  90.     fi
  91. done
  92.  
  93. rm -f /dev/arp /dev/icmp /dev/igmp /dev/incfg /dev/ipip \
  94.       /dev/ip /dev/loop /dev/rawip /dev/rip /dev/tcp /dev/udp \
  95.       /dev/icmpv6 /dev/ipv6 /dev/rawipv6 /dev/ripv6 /dev/tcpipv6 /dev/udpipv6 \
  96.       /dev/inet/arp /dev/inet/icmp /dev/inet/igmp /dev/inet/cfg \
  97.       /dev/inet/ip /dev/inet/ipip /dev/inet/loop /dev/inet/rawip /dev/inet/rip \
  98.       /dev/inet/icmpv6 /dev/inet/ipv6 /dev/inet/rawipv6 /dev/inet/ripv6 \
  99.       /dev/inet/udp /dev/inet/udpipv6 || exit 1
  100. rm -f /dev/inet/tcp*  || exit 1
  101.  
  102. #
  103. # Remove the entries from /etc/netconfig
  104. #
  105.  
  106. grep -v '[     ]inet6*[     ][     ]*tcp[     ][     ]*/dev/tcp[ipv6]*[     ]' /etc/netconfig 2>/dev/null >/tmp/$$.1
  107. grep -v '[     ]inet6*[     ][     ]*udp[     ][     ]*/dev/udp[ipv6]*[     ]' /tmp/$$.1 2>/dev/null >/tmp/$$.2
  108. grep -v '[     ]inet6*[     ][     ]*icmp[     ][     ]*/dev/icmp[v6]*[     ]' /tmp/$$.2 2>/dev/null >/tmp/$$.3
  109. grep -v '[     ]inet6*[     ][     ]*igmp[     ][     ]*/dev/igmp[     ]' /tmp/$$.3 2>/dev/null >/tmp/$$.1
  110. grep -v '[     ]inet6*[     ][     ]*-[     ][     ]*/dev/rawip[v6]*[     ]' /tmp/$$.1 2>/dev/null >/etc/netconfig
  111.  
  112. rm -f /tmp/$$.1 /tmp/$$.2 /tmp/$$.3
  113.  
  114. #
  115. # Remove *.tcp entries from /etc/uucp/Sysfiles
  116. #
  117.  
  118. if [ -s /etc/uucp/Sysfiles ]
  119. then
  120.     grep -v "\.tcp" /etc/uucp/Sysfiles 2>/dev/null >/tmp/Sys.$$
  121.     cp /tmp/Sys.$$ /etc/uucp/Sysfiles
  122. fi
  123.  
  124. #
  125. #    Remove ourself from the OAM Scripts...
  126. #
  127.  
  128. #grep -v 'inet^Internet Protocols (TCP and UDP)^inet/Menu.inet' /usr/sadm/sysadm/menu/netservices/name_to_addr/map.menu 2>/dev/null >/tmp/$$.1
  129. #cp /tmp/$$.1 /usr/sadm/sysadm/menu/netservices/name_to_addr/map.menu
  130.  
  131.  
  132. #
  133. #    Remove SCOadmin managers
  134. #
  135.  
  136. CLASSCONF=/sbin/classconf
  137. OSACONF=/sbin/osaconf
  138.  
  139. /usr/bin/scoadmin -p Networking -d dns.obj
  140. /usr/bin/scoadmin -p Networking -d ncm.obj
  141. /usr/bin/scoadmin -p Networking -d ftp.obj
  142. /usr/bin/scoadmin -p Networking -d pic.obj
  143. /usr/bin/scoadmin -p Networking -d aas.obj
  144. /usr/bin/scoadmin -p Networking -d dhcp.obj
  145. /usr/bin/scoadmin -H /usr/lib/netcfg/wansw -d slip.obj
  146.  
  147. ${CLASSCONF} -D sco inconfig inconfigOsa
  148. ${OSACONF} -D sco inconfigOsa
  149.  
  150. ${CLASSCONF} -D sco netInterface netInterfaceOsa
  151. ${OSACONF} -D sco netInterfaceOsa
  152.  
  153. ${CLASSCONF} -D sco ftp ftpOsa
  154. ${CLASSCONF} -D sco ftpDenyHost ftpOsa
  155. ${CLASSCONF} -D sco ftpDenyUser ftpOsa
  156. ${CLASSCONF} -D sco ftpAccess ftpOsa
  157. ${CLASSCONF} -D sco ftpMessage ftpOsa
  158. ${CLASSCONF} -D sco ftpClass ftpOsa
  159. ${CLASSCONF} -D sco ftpLimit ftpOsa
  160. ${CLASSCONF} -D sco ftpLog ftpOsa
  161. ${CLASSCONF} -D sco ftpShutdown ftpOsa
  162. ${CLASSCONF} -D sco ftpVirtual ftpOsa
  163. ${CLASSCONF} -D sco ftpAnon ftpOsa
  164. ${CLASSCONF} -D sco ftpAnonHome ftpOsa
  165. ${OSACONF} -D sco ftpOsa
  166.  
  167. ${CLASSCONF} -D sco dNSystem dnsOsa
  168. ${CLASSCONF} -D sco dNSPrimary dnsOsa
  169. ${CLASSCONF} -D sco dNSSecondary dnsOsa
  170. ${CLASSCONF} -D sco dNSStub dnsOsa
  171. ${CLASSCONF} -D sco dNSHint dnsOsa
  172. ${CLASSCONF} -D sco hostTabs dnsOsa
  173. ${CLASSCONF} -D sco hostTab dnsOsa
  174. ${CLASSCONF} -D sco hostTabEntry dnsOsa
  175. ${OSACONF} -D sco dnsOsa
  176.  
  177. ${CLASSCONF} -D sco nis ncmOsa
  178. ${CLASSCONF} -D sco ntp ncmOsa
  179. ${CLASSCONF} -D sco netconfig ncmOsa
  180. ${OSACONF} -D sco ncmOsa
  181.  
  182. ${CLASSCONF} -D sco aasPool aasOsa
  183. ${CLASSCONF} -D sco aasServer aasOsa
  184. ${CLASSCONF} -D sco aasDatabase aasOsa
  185. ${CLASSCONF} -D sco aasLocation aasOsa
  186. ${OSACONF} -D sco aasOsa
  187.  
  188. ${CLASSCONF} -D sco dhcpSubnet dhcpOsa
  189. ${CLASSCONF} -D sco dhcpClient dhcpOsa
  190. ${CLASSCONF} -D sco dhcpUserClass dhcpOsa
  191. ${CLASSCONF} -D sco dhcpVendorClass dhcpOsa
  192. ${CLASSCONF} -D sco dhcpOption dhcpOsa
  193. ${CLASSCONF} -D sco dhcpGlobal dhcpOsa
  194. ${CLASSCONF} -D sco dhcpStandard dhcpOsa
  195. ${CLASSCONF} -D sco dhcpServer dhcpOsa
  196. ${OSACONF} -D sco dhcpOsa
  197.  
  198. #
  199. # Remove the port monitor entry
  200. #
  201.  
  202. sacadm -r -p inetd >/dev/null 2>&1
  203. sacadm -r -p tcp >/dev/null 2>&1
  204. adminuser -r inetd root >/dev/null 2>&1
  205. #/usr/bin/adminrole -r \
  206. #   nslookup,rdate,ifconfig,in.routed,route,nslookup,slink,arp,ruptime,rwho,in.rwhod,in.named \
  207. #   NET >/dev/null 2>&1
  208.  
  209. if    [ "${REBUILD}" = "1" ]
  210. then
  211.     /etc/conf/bin/idbuild 2>> $TMP
  212.     if [ $? != 0 ]
  213.     then
  214.         message $ERROR2
  215.         exit 1
  216.     fi
  217.     exit 10
  218. fi
  219.  
  220. exit 0
  221.  
  222.