mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 17:52:46 +01:00
refactor elastic-agent download for soup ctrl+c anomalies
This commit is contained in:
@@ -1014,25 +1014,9 @@ detect_os() {
|
||||
}
|
||||
|
||||
download_elastic_agent_artifacts() {
|
||||
agentArchive=/nsm/elastic-fleet/artifacts/elastic-agent_SO-$ELASTIC_AGENT_TARBALL_VERSION.tar.gz
|
||||
agentMd5=/nsm/elastic-fleet/artifacts/elastic-agent_SO-$ELASTIC_AGENT_TARBALL_VERSION.md5
|
||||
beatsDir=/nsm/elastic-fleet/artifacts/beats/elastic-agent
|
||||
logCmd "mkdir -p $beatsDir"
|
||||
if [[ ! -f "$agentArchive" ]]; then
|
||||
retry 15 10 "curl --fail --retry 5 --retry-delay 15 -L https://repo.securityonion.net/file/so-repo/prod/2.4/elasticagent/elastic-agent_SO-$ELASTIC_AGENT_TARBALL_VERSION.tar.gz --output $agentArchive" "" ""
|
||||
retry 15 10 "curl --fail --retry 5 --retry-delay 15 -L https://repo.securityonion.net/file/so-repo/prod/2.4/elasticagent/elastic-agent_SO-$ELASTIC_AGENT_TARBALL_VERSION.md5 --output $agentMd5" "" ""
|
||||
|
||||
SOURCEHASH=$(md5sum $agentArchive | awk '{ print $1 }')
|
||||
HASH=$(cat $agentMd5)
|
||||
|
||||
if [[ "$HASH" == "$SOURCEHASH" ]]; then
|
||||
info "Elastic Agent source hash is good."
|
||||
else
|
||||
info "Unable to download the Elastic Agent source files."
|
||||
fail_setup
|
||||
fi
|
||||
if ! update_elastic_agent 2>&1 | tee -a "$setup_log"; then
|
||||
fail_setup
|
||||
fi
|
||||
logCmd "tar -xf $agentArchive -C $beatsDir"
|
||||
}
|
||||
|
||||
installer_progress_loop() {
|
||||
|
||||
Reference in New Issue
Block a user