Last active
December 22, 2021 23:59
-
-
Save keithchambers/3959adb3a19948e1ba3b to your computer and use it in GitHub Desktop.
Verify RPMs with rpm and yum-verify.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
IFS=$'\n' | |
function rpm_verify() | |
{ | |
RPMS="$(rpm -qa)" | |
for RPM in $RPMS ; do | |
RESULT="$(nice -n +19 rpm -V "$RPM" | awk '$2 != "c" {print $1, $NF}')" | |
if [[ "$RESULT" ]] ; then | |
for LINE in "$RESULT" ; do | |
echo "$LINE" "$RPM" | |
done | |
fi | |
done | |
} | |
function yum_verify() | |
{ | |
rpm -q yum-plugin-verify >/dev/null && nice -n +19 yum verify | tail -n +3 | |
} | |
# main | |
rpm_verify | |
yum_verify | |
echo "Completed in "$SECONDS" seconds." | |
# EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment