home *** CD-ROM | disk | FTP | other *** search
/ The-Coder - The Official Indigo Games / indigo_games.iso / loadit < prev    next >
Encoding:
Text File  |  1993-03-10  |  1.1 KB  |  48 lines

  1. #!/bin/sh
  2.  
  3. CDPATH=`pwd`/dist
  4. rootdir=/usr/src/IndigoGames
  5. dir=$rootdir/$1
  6. srcdir=$CDPATH/src/$1
  7. need="`du -sk $srcdir | awk ' /dev/ {print $1}' `"
  8.  
  9. if [ ! -d "$rootdir" ]; then
  10.     mkdir $rootdir
  11. fi
  12.  
  13. free="`df -k $rootdir | awk ' /dev/ {print $5}' `"
  14. if [ "$?" != 0 ]; then
  15.     echo "Error determining disk space available on $rootdir."
  16.     echo "Attempting to proceed with installation."
  17.     free=$need+50
  18. fi
  19.  
  20. if [ "$free" -ge "$need" ]; then
  21.     if [ ! -d "$dir" ]; then
  22.         mkdir $dir
  23.         if [ "$?" != 0 ]; then
  24.             ans=`/usr/sbin/confirm -B "ok" -t "Could not create $dir directory." \
  25.             -t "You must be root to install software."`
  26.             exit 1
  27.         fi
  28.     else
  29.         rm -rf $dir
  30.         mkdir $dir
  31.         if [ "$?" != 0 ]; then
  32.             ans=`/usr/sbin/confirm -B "ok" -t "Could not create $dir directory." \
  33.             -t "You must be root to install software."`
  34.             exit 1
  35.         fi
  36.     fi
  37. else
  38.     ans=`/usr/sbin/confirm -B "ok" -t "Not enough disk space available on $rootdir" \
  39.     -t "to install $1 source.  At least $need KB of disk space is" \
  40.     -t "required.  Make space and then try to install again."`
  41.     exit 1
  42. fi
  43.  
  44. ###    Add command to start install script here. ###
  45.  
  46. inform "Installing $1 source." &
  47. cp -r $srcdir/* $dir
  48.