Skip to content

Instantly share code, notes, and snippets.

@keithchambers
Last active December 22, 2021 23:59
Show Gist options
  • Save keithchambers/3959adb3a19948e1ba3b to your computer and use it in GitHub Desktop.
Save keithchambers/3959adb3a19948e1ba3b to your computer and use it in GitHub Desktop.
Verify RPMs with rpm and yum-verify.
#!/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