#!/bin/bash
# Copyright (c) Microsoft Corporation. All rights reserved.
# Highly Confidential Material

# Collects diagnostics for the ingestion agent running on this system and gathers them to a file in the current
# directory.
set -euo pipefail

  DIAGS_DIR="/var/log/az-aoi-ingestion"
  if [[ -d $DIAGS_DIR ]]; then
      packagefile="az-aoi-ingestion-diagnostics-$(date '+%Y%m%d-%H%M%S').zip"
      zip -r "$packagefile" "$DIAGS_DIR"
      echo "Generated diagnostics file $packagefile for az-aoi-ingestion"
  fi
