#!/bin/bash

set -euo pipefail

BUILD_DIR=$1
CACHE_DIR=$2
DEPS_DIR=$3
DEPS_IDX=$4

BUILDPACK_DIR=$(dirname `dirname $0`)

echo "-----> Running sidecar supply"

echo "-----> Creating CavissonAgent as sidecar"
mkdir "$DEPS_DIR"/netdiagnostics
tar -xzf $BUILDPACK_DIR/bin/netdiagnostics.4.14.0.85.tar.gz -C "$DEPS_DIR"/netdiagnostics/
cp $BUILDPACK_DIR/bin/ndsettings.conf "$DEPS_DIR"/netdiagnostics/config
echo "-----> Completed deployment of CavissonAgent as sidecar"
