mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
update elastic_fleet_agent_policy_ids scripts already check rc
This commit is contained in:
@@ -131,10 +131,11 @@ elastic_fleet_installed_packages() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
elastic_fleet_agent_policy_ids() {
|
elastic_fleet_agent_policy_ids() {
|
||||||
curl -s -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X GET "localhost:5601/api/fleet/agent_policies" | jq -r .items[].id
|
if output=$(curl -s -K /opt/so/conf/elasticsearch/curl.config -b "sid=$SESSIONCOOKIE" -L -X GET "localhost:5601/api/fleet/agent_policies" --retry 3 --fail 2>/dev/null);
|
||||||
if [ $? -ne 0 ]; then
|
echo "$output" | jq -r .items[].id
|
||||||
|
else
|
||||||
echo "Error: Failed to retrieve agent policies."
|
echo "Error: Failed to retrieve agent policies."
|
||||||
exit 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user