#! /bin/csh -f # # rpm check to defeat hackers that know how to toy with rpm databases :-) # careful, the tar file should not be compressed, as timestamps will # enter the checksum and hence make it time-dependant on the creation foreach a ($*) set $a end set version="1998-oct-6: PJT" set tar=/tmp/rpmbackup.tar set rpm=/var/lib/rpm set log=() #set log=($rpm/rpm.vlog) #---------#---------#---------#---------#---------#---------#---------#-------- echo "$0 : Version $version" if (! -d $rpm) then echo Directory $rpm does not exist. exit 1 endif if (X$log != X) then echo "Generating new $log (this can take a few minutes)" rpm -Va > $log endif echo Writing $tar tar cf $tar /var/lib/rpm set sumout=(`sum $tar`) echo "Checksum = $sumout[1], please store this number in your wallet."