[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Opps sorry, here's a text file



>Your idea sounds great. By the way how do I read a word doc with linux?
>-Jeff


 Humm, didn't really think of that one, here it is again as a plain text
file, sorry.
#!/bin/sh

create_it()
{
 echo /bin > /tmp/new
 ls -AlFR /bin >> /tmp/new
  echo /lib >> /tmp/new
 ls -AlFR /lib >> /tmp/new
 echo /root >> /tmp/new
 ls -AlFR /root >> /tmp/new
 echo /sbin >> /tmp/new
 ls -AlFR /sbin >> /tmp/new
 echo /var >> /tmp/new
 ls -AlFR /var >> /tmp/new
 echo /usr >> /tmp/new
 ls -AlFR /usr >> /tmp/new
}

#check to see if the manager has already been installed
if  [ ! -f /tmp/base ]; then
     echo "As the manager has not been run \
     on this computer before the master file\
     listing must be created.  This may take\
     a few minutes."
     create_it
     mv /tmp/new /tmp/base
     mkdir /var/log/programs
     exit
fi

echo "Manage which program"
read PROGNAME
echo "Building New file database"
create_it
echo -n "creating new program entry for "
echo $PROGNAME
touch /var/tmp/$PROGNAME 
echo $PROGNAME > /tmp/$PROGNAME 
echo -n "Installation Date: " >> /tmp/$PROGNAME
date >> /tmp/$PROGNAME
diff -U 0 /tmp/base /tmp/new | tr -d -s ['+' '@'] | grep -v total >> /tmp/files
#################
#
# what follows create the actual records for the program database
#
#################

# delete the line numbers that diff places
grep -v @ /tmp/files > /tmp/files1

# remove the entries for /tmp/base & /tmp/new (which will always change)
grep -v /tmp /tmp/files1 >files2

# remove files and rename files2 to files
rm /tmp/files files1
mv /tmp/files2 files

cat /tmp/files >> /tmp/$PROGNAME
echo "installing the new program"
##mv /tmp/$PROGNAME /var/log/programs
echo "cleaning up"
##rm /tmp/base /tmp/files /var/tmp/newfiles
##mv /tmp/new /tmp/base
##echo "updating system files"
##updatedb --prunepaths='/home /proc /cdrom /msdos /zip'
##ldconfig
echo "done"