Only load if so-elastic-fleet-common exists

This commit is contained in:
weslambert
2023-06-23 16:03:58 -04:00
committed by GitHub
parent aa91c1fef2
commit e2ff48164b

View File

@@ -15,6 +15,7 @@ default_conf_dir=/opt/so/conf
# Define a default directory to load pipelines from
ELASTICSEARCH_TEMPLATES="$default_conf_dir/elasticsearch/templates/"
if [ -f /usr/sbin/so-elastic-fleet-common ]; then
# Wait for ElasticSearch to initialize
echo -n "Waiting for ElasticSearch..."
COUNT=0
@@ -72,5 +73,8 @@ cd ${ELASTICSEARCH_TEMPLATES}/index
echo "Loading Security Onion index templates..."
for i in *; do TEMPLATE=${i::-14}; echo "$TEMPLATE"; so-elasticsearch-query _index_template/$TEMPLATE -d@$i -XPUT 2>/dev/null; echo; done
echo
else
echo "Elastic Fleet not configured. Exiting..."
exit 0
fi
cd - >/dev/null