From 4d26e9517c4c25c9915cbd5ef12e3a48b2a1b076 Mon Sep 17 00:00:00 2001 From: Hyeongju Johannes Lee Date: Thu, 26 Sep 2024 12:40:30 -0700 Subject: [PATCH] qat, initcontainer: Improve the logic of config check The check_config function previously only considered the ServicesEnabled variable. Improve the logic of the function so that other variables can also be set through the qat.conf file. Signed-off-by: Hyeongju Johannes Lee --- demo/qat-init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/qat-init.sh b/demo/qat-init.sh index 970fb153..1407463b 100755 --- a/demo/qat-init.sh +++ b/demo/qat-init.sh @@ -12,8 +12,8 @@ SERVICES_ENABLED="NONE" SERVICES_ENABLED_FOUND="FALSE" check_config() { - [ -f "conf/qat.conf" ] && SERVICES_ENABLED=$(cut -d= -f 2 conf/qat.conf | grep '\S') - [ -f "conf/qat-$NODE_NAME.conf" ] && SERVICES_ENABLED=$(cut -d= -f 2 conf/qat-$NODE_NAME.conf | grep '\S') + [ -f "conf/qat.conf" ] && SERVICES_ENABLED=$(grep "^ServicesEnabled=" conf/qat.conf | cut -d= -f 2 | grep '\S') + [ -f "conf/qat-$NODE_NAME.conf" ] && SERVICES_ENABLED=$(grep "^ServicesEnabled=" conf/qat-"$NODE_NAME".conf | cut -d= -f 2 | grep '\S') if [ "$SERVICES_ENABLED" != "NONE" ]; then SERVICES_ENABLED_FOUND="FALSE"