From 87fa93358e4be559f5deccc8bc5937191247f141 Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Fri, 25 Jul 2025 09:11:06 +0800 Subject: [PATCH] Fix shellcheck warning and typos Relates: https://issues.redhat.com/browse/RHEL-105471 Upstream: Fedora Conflict: None Fix the following shellcheck warning, In ima-add-sigs.sh line 135: unsigned_packages_in_rpm_db=$(rpm -q --queryformat "%{SIGPGP:pgpsig}\n" "$package" | grep "^(none)$" | wc -l) ^-------------^ SC2126 (style): Consider using 'grep -c' instead of 'grep|wc -l'. Also fix two typos. Signed-off-by: Coiby Xu --- ima-add-sigs.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ima-add-sigs.sh b/ima-add-sigs.sh index 890eacb..6be5c48 100755 --- a/ima-add-sigs.sh +++ b/ima-add-sigs.sh @@ -4,7 +4,7 @@ usage() { echo "Add IMA signatures to installed packages." cat <reinstall_threshold package missing IMA signatures. - --ima-cert + --ima_cert With the signing IMA cert path specified, it will also try to verify the added IMA signature. @@ -132,7 +132,7 @@ if [[ -z $reinstall_threshold ]]; then fi fi -unsigned_packages_in_rpm_db=$(rpm -q --queryformat "%{SIGPGP:pgpsig}\n" "$package" | grep "^(none)$" | wc -l) +unsigned_packages_in_rpm_db=$(rpm -q --queryformat "%{SIGPGP:pgpsig}\n" "$package" | grep -c "^(none)$") if [[ $unsigned_packages_in_rpm_db -ge $reinstall_threshold ]]; then add_by_reinstall