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

  1. #ident    "@(#)preremove    1.2"
  2. #
  3. # preremove
  4. #
  5. LOCALE=ja
  6.  
  7. #
  8. # Remove printers from scoadmin printer model file
  9. #
  10. # the Japanese printers may have been installed through a number of means.
  11. # Only if they were installed using JMODEL file do we need to do something
  12. # now.
  13. #
  14. JMODEL=/usr/lib/scoadmin/printer/model.stz.${LOCALE}
  15.  
  16. [ -f /usr/lib/scoadmin/printer/model.stz ] && {
  17.     for F in `grep "^japan" $JMODEL`
  18.     do
  19.         awk '{
  20.             if (match($0, MODEL)) {
  21.                 while (NF !=0 )
  22.                     getline
  23.                 getline
  24.             }
  25.             print
  26.         }' MODEL=$F /usr/lib/scoadmin/printer/model.stz \
  27.             > /usr/lib/scoadmin/printer/model.stz.tmp
  28.         mv /usr/lib/scoadmin/printer/model.stz.tmp \
  29.             /usr/lib/scoadmin/printer/model.stz
  30.     done
  31. }
  32.  
  33. #
  34. # take care of filter.table
  35. #
  36. FDLIST=/etc/inst/locale/${LOCALE}/lp/FDLIST.${LOCALE}
  37. LPFILTER=/usr/sbin/lpfilter
  38.  
  39. if [ -x ${LPFILTER} -a -r ${FDLIST} ]
  40. then
  41.     while read fd
  42.     do
  43.         filter=`expr "${fd}" : '.*/\([^/]*\)\.fd$'`
  44.         ${LPFILTER} -f ${filter} -x 2>/dev/null
  45.     done < ${FDLIST}
  46. fi
  47.  
  48. #
  49. # restore postprint filter
  50. #
  51. ${LPFILTER} -f postprint -i 2>/dev/null
  52.  
  53. exit 0
  54.