home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / Other / Coherent / base / disk1.4.10.dd / etc / install.u < prev    next >
Encoding:
Text File  |  1994-03-07  |  1.1 KB  |  63 lines

  1. # /etc/install.u - uncompress archives on a distribution.
  2. # Revised: Mon Mar  7 15:36:13 1994 CST
  3.  
  4. # Called from /etc/install in build or update mode.
  5.  
  6. # Command argument "-u" indicates a COHERENT update.
  7. # Won't extract files in /conf/upd_suppress from .taz archives.
  8. _UPDATE=
  9. for ARG; do
  10.     case $ARG in
  11.     -u)
  12.         _UPDATE=y
  13.         ;;
  14.     esac
  15. done
  16.  
  17. COMPDIR=/mnt/compressed
  18.  
  19. # If directory of compressed archives does not exist, do nothing.
  20.  
  21. if [ ! -d "$COMPDIR" ]; then
  22.     exit 0
  23. fi
  24.  
  25. # Echo commands.  Exit with nonzero status if any command fails.
  26.  
  27. set -x
  28.  
  29. # Archives are written to be uncompressed from root level.
  30.  
  31. cd /
  32.  
  33. # For each archive file, decide how to uncompress and go.
  34.  
  35. for Archive in $COMPDIR/* ; do
  36.  
  37.     case $Archive in 
  38.  
  39.     *.taz)    
  40.         if [ ${_UPDATE} ]; then
  41.             /usr/bin/gtar -xzpv -X /conf/upd_suppress -f $Archive
  42.         else
  43.             /usr/bin/gtar -xzpv -f $Archive
  44.         fi
  45.         ;;
  46.  
  47.     *tar*)    
  48.         /usr/bin/gunzip -c $Archive | /usr/bin/ustar xf -
  49.         ;;
  50.  
  51.     *cpio*)    
  52.         /usr/bin/gunzip -c $Archive | /usr/bin/cpio -icdmu
  53.         ;;
  54.  
  55.     *) echo "Unknown archive type in file $Archive"
  56.         ;;
  57.  
  58.     esac 
  59.     sync
  60. done
  61.  
  62. exit 0
  63.