home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- CDPATH=`pwd`/dist
- rootdir=/usr/src/IndigoGames
- dir=$rootdir/$1
- srcdir=$CDPATH/src/$1
- need="`du -sk $srcdir | awk ' /dev/ {print $1}' `"
-
- if [ ! -d "$rootdir" ]; then
- mkdir $rootdir
- fi
-
- free="`df -k $rootdir | awk ' /dev/ {print $5}' `"
- if [ "$?" != 0 ]; then
- echo "Error determining disk space available on $rootdir."
- echo "Attempting to proceed with installation."
- free=$need+50
- fi
-
- if [ "$free" -ge "$need" ]; then
- if [ ! -d "$dir" ]; then
- mkdir $dir
- if [ "$?" != 0 ]; then
- ans=`/usr/sbin/confirm -B "ok" -t "Could not create $dir directory." \
- -t "You must be root to install software."`
- exit 1
- fi
- else
- rm -rf $dir
- mkdir $dir
- if [ "$?" != 0 ]; then
- ans=`/usr/sbin/confirm -B "ok" -t "Could not create $dir directory." \
- -t "You must be root to install software."`
- exit 1
- fi
- fi
- else
- ans=`/usr/sbin/confirm -B "ok" -t "Not enough disk space available on $rootdir" \
- -t "to install $1 source. At least $need KB of disk space is" \
- -t "required. Make space and then try to install again."`
- exit 1
- fi
-
- ### Add command to start install script here. ###
-
- inform "Installing $1 source." &
- cp -r $srcdir/* $dir
-