From c71afcaafe3b2ca445aad082357990ba21db927b Mon Sep 17 00:00:00 2001 From: Cody Herriges <193064+ody@users.noreply.github.com> Date: Wed, 21 Sep 2022 18:37:18 +0000 Subject: [PATCH] Ensure fips commands exists before using it Commit fixes failures which occur in some Bolt operating scenarios when OS is a RedHat derivative and commands for enabling fips are missing. --- tasks/precheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/precheck.sh b/tasks/precheck.sh index 6f3cd925..c4ef7506 100755 --- a/tasks/precheck.sh +++ b/tasks/precheck.sh @@ -7,7 +7,7 @@ if grep -qi ubuntu /etc/os-release; then osfamily="ubuntu" elif grep -qi sles /etc/os-release; then osfamily="sles" -elif grep -qi redhat /etc/os-release && fips-mode-setup --is-enabled; then +elif grep -qi redhat /etc/os-release && (which fips-mode-setup &>/dev/null && fips-mode-setup --is-enabled); then osfamily="redhatfips" else osfamily="el"