Enable upgrade check during state run

This commit is contained in:
Josh Brower
2023-08-09 10:43:34 -04:00
parent e586d6b967
commit bf78faa0f0
2 changed files with 7 additions and 2 deletions

View File

@@ -14,8 +14,8 @@ fi
RAW_JSON=$(curl -K /opt/so/conf/elasticsearch/curl.config -L "http://localhost:5601/api/fleet/agents?perPage=20&page=1&kuery=policy_id%20%3A%20so-grid-nodes_%2A&showInactive=false&showUpgradeable=true&getStatusSummary=true")
# Check to make sure that the server responded with good data - else, bail from script
CHECKSUM=$(jq -r '.statusSummary.online' <<< "$RAW_JSON")
if [ "$CHECKSUM" -lt 1 ]; then
CHECKSUM=$(jq -r '.page' <<< "$RAW_JSON")
if [ "$CHECKSUM" -ne 1 ]; then
printf "Failed to query for current Grid Agents...\n"
exit 1
fi