#!/bin/bash # # update-cat version 1.2 (20/10/2000) # # This script does the following things: # # 1. Cleans up the CD tree, removing TRANS.TBL files, backup files # and core dumps. # # 2. Regenerates the compiled package list for the RedHat installer. # # 3. Creates a file list and a list of MD5 sums. This can be used to # verify that a CD was written correctly after the fact, by running # the "check-md5s" script. # # This script is in the public domain, use as you please (but I do like # getting credit, cash and/or feedback from my work, hint hint). # # - Bjarni R. Einarsson # http://bre.klaki.net/ # ############################################################################# # RedHat 5.x, 6.0 and 6.1 #GENHDLIST=misc/src/install/genhdlist # RedHat 6.2 GENHDLIST=misc/src/anaconda/utils/genhdlist if [ -e ../$GENHDLIST ]; then cd .. fi if [ ! -e $GENHDLIST ]; then echo echo "ERROR: Couldn't find $GENHDLIST!" echo echo "This program must be run from the root of your RedHat CD tree." echo exit 1 fi echo "Cleaning up..." rm -f core $(find . -name core) rm -f core $(find . -name '*~') rm -f core $(find . -name TRANS.TBL) echo "Regenerating hdlist..." $GENHDLIST $(pwd) # Uncomment the following line if you want neither a file list nor a # MD5 sum list. exit 0 echo "Updating misc/files.txt..." find . -type f \ | grep -v -e boot.cat -e misc/md5sums.txt -e misc/files.txt -e misc/bre -e BURNT \ > misc/files.txt FNUM=$(wc -l misc/files.txt|awk '{print $1}') COUNT=1 SP=" " # Uncomment the following line if you don't want to make a list of MD5 sums. exit 0 echo "Creating misc/md5sums.txt, this may take a while!" touch misc/md5sums.txt [ -L misc/md5sums.txt ] && exit 1 cp /dev/null misc/md5sums.txt cat misc/files.txt \ | while read FILENAME; do echo -n -e "$SP\rMD5: $COUNT/$FNUM $FILENAME\r" md5sum "$FILENAME" >>misc/md5sums.txt let COUNT=$COUNT+1 done echo