I have had this in my toolbox for a while and am always recreating it on any RPM based distribution.
So might as well dump it here
#!/bin/sh
export logFile=/var/log/versys.log
if [ $# -gt 0 ]
then
if [ "$1" == "-r" ]
then
cat $logFile | grep -v ">>" | less
else
echo
echo "$0 [-r]"
echo
echo "No args to generate, -r to view the report"
echo
fi
else
echo ">>>> VerSys Initialising: `date` <<<<" | tee -a $logFile
echo ">>>> Writing to: $logFile <<<<" | tee -a $logFile
echo ">>>> RPM list & Sort <<<<" | tee -a $logFile
for i in `rpm -qa | sort`
do
echo ">>>> VERIFYING $i" <<<<" | tee -a $logFile
rpm -V $i | tee -a $logFile
done
fi
31 minutes ago