From 93d12d214306d31c08c078e187a9e70b348e0847 Mon Sep 17 00:00:00 2001 From: krzee <4845550+krzee@users.noreply.github.com> Date: Wed, 11 Aug 2021 15:11:43 -0700 Subject: [PATCH] in bash if already tests exit status is 0 or not The other way works too, but it seems pointless to go through extra steps when the if command already does exactly this --- kibana-odfe/config/wazuh_app_config.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kibana-odfe/config/wazuh_app_config.sh b/kibana-odfe/config/wazuh_app_config.sh index fddf93b4..048f1f17 100644 --- a/kibana-odfe/config/wazuh_app_config.sh +++ b/kibana-odfe/config/wazuh_app_config.sh @@ -47,10 +47,7 @@ done CONFIG_CODE=$(curl ${auth} -s -o /dev/null -w "%{http_code}" -XGET $el_url/.wazuh/_doc/1513629884013) -grep -q 1513629884013 $kibana_config_file -_config_exists=$? - -if [[ "x$CONFIG_CODE" != "x200" && $_config_exists -ne 0 ]]; then +if [[ "x$CONFIG_CODE" != "x200" ]] && ! grep -q 1513629884013 $kibana_config_file ; then cat << EOF >> $kibana_config_file hosts: - 1513629884013: