mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-08 02:02:50 +01:00
Don't use state; set IFS
This commit is contained in:
@@ -6,14 +6,11 @@
|
|||||||
|
|
||||||
. /usr/sbin/so-elastic-fleet-common
|
. /usr/sbin/so-elastic-fleet-common
|
||||||
|
|
||||||
RETURN_CODE=0
|
# Let's snag a cookie from Kibana
|
||||||
|
SESSIONCOOKIE=$(curl -s -K /opt/so/conf/elasticsearch/curl.config -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
|
||||||
|
|
||||||
if [ ! -f /opt/so/state/eaintegrationupgrade.txt ]; then
|
# List agent policies
|
||||||
# Let's snag a cookie from Kibana
|
for AGENT_POLICY in $(elastic_fleet_agent_policy_names); do
|
||||||
SESSIONCOOKIE=$(curl -s -K /opt/so/conf/elasticsearch/curl.config -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
|
|
||||||
|
|
||||||
# List agent policies
|
|
||||||
for AGENT_POLICY in $(elastic_fleet_agent_policy_names); do
|
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
for INTEGRATION in $(elastic_fleet_integration_policy_names "$AGENT_POLICY"); do
|
for INTEGRATION in $(elastic_fleet_integration_policy_names "$AGENT_POLICY"); do
|
||||||
if ! [[ "$INTEGRATION" == "elastic-defend-endpoints" ]] && ! [[ "$INTEGRATION" == "fleet_server-"* ]]; then
|
if ! [[ "$INTEGRATION" == "elastic-defend-endpoints" ]] && ! [[ "$INTEGRATION" == "fleet_server-"* ]]; then
|
||||||
@@ -41,11 +38,5 @@ if [ ! -f /opt/so/state/eaintegrationupgrade.txt ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
if [[ "$RETURN_CODE" != "1" ]]; then
|
echo
|
||||||
touch /opt/so/state/eaintegrationupgrade.txt
|
|
||||||
fi
|
|
||||||
echo
|
|
||||||
else
|
|
||||||
exit $RETURN_CODE
|
|
||||||
fi
|
|
||||||
|
|||||||
Reference in New Issue
Block a user