Skip to content

Commit 4d26e95

Browse files
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 <[email protected]>
1 parent b505897 commit 4d26e95

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

demo/qat-init.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ SERVICES_ENABLED="NONE"
1212
SERVICES_ENABLED_FOUND="FALSE"
1313

1414
check_config() {
15-
[ -f "conf/qat.conf" ] && SERVICES_ENABLED=$(cut -d= -f 2 conf/qat.conf | grep '\S')
16-
[ -f "conf/qat-$NODE_NAME.conf" ] && SERVICES_ENABLED=$(cut -d= -f 2 conf/qat-$NODE_NAME.conf | grep '\S')
15+
[ -f "conf/qat.conf" ] && SERVICES_ENABLED=$(grep "^ServicesEnabled=" conf/qat.conf | cut -d= -f 2 | grep '\S')
16+
[ -f "conf/qat-$NODE_NAME.conf" ] && SERVICES_ENABLED=$(grep "^ServicesEnabled=" conf/qat-"$NODE_NAME".conf | cut -d= -f 2 | grep '\S')
1717

1818
if [ "$SERVICES_ENABLED" != "NONE" ]; then
1919
SERVICES_ENABLED_FOUND="FALSE"

0 commit comments

Comments
 (0)