mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 01:32:47 +01:00
make package installs go in groups of 25 or less
This commit is contained in:
@@ -148,8 +148,22 @@ if [[ -f $STATE_FILE_SUCCESS ]]; then
|
|||||||
done <<< "$(jq -c '.packages[]' "$INSTALLED_PACKAGE_LIST")"
|
done <<< "$(jq -c '.packages[]' "$INSTALLED_PACKAGE_LIST")"
|
||||||
|
|
||||||
if [ "$PENDING_UPDATE" = true ]; then
|
if [ "$PENDING_UPDATE" = true ]; then
|
||||||
# Run bulk install of packages
|
# Run chunked install of packages
|
||||||
elastic_fleet_bulk_package_install $BULK_INSTALL_PACKAGE_LIST > $BULK_INSTALL_OUTPUT
|
echo "" > $BULK_INSTALL_OUTPUT
|
||||||
|
pkg_group=1
|
||||||
|
pkg_filename="${BULK_INSTALL_PACKAGE_LIST%.json}"
|
||||||
|
|
||||||
|
jq -c '.packages | _nwise(25)' $BULK_INSTALL_PACKAGE_LIST | while read -r line; do
|
||||||
|
echo "$line" | jq '{ "packages": . }' > "${pkg_filename}_${pkg_group}.json"
|
||||||
|
pkg_group=$((pkg_group + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
for file in "${pkg_filename}_"*.json; do
|
||||||
|
[ -e "$file" ] || continue
|
||||||
|
elastic_fleet_bulk_package_install $file >> $BULK_INSTALL_OUTPUT
|
||||||
|
done
|
||||||
|
# cleanup any temp files for chunked package install
|
||||||
|
rm -f ${pkg_filename}_*.json $BULK_INSTALL_PACKAGE_LIST
|
||||||
else
|
else
|
||||||
echo "Elastic integrations don't appear to need installation/updating..."
|
echo "Elastic integrations don't appear to need installation/updating..."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user