#!/bin/sh
#
#  trento-install-checks
#
#  This script installs the checks into the directory Wanda expects them.  It
#  is required, for Kubernetes style sidecar containers and should not be used
#  in regular deployments using docker
#

checks_src="/usr/src/trento-checks/checks"
checks_target="/usr/share/trento/checks"

install -d -m 0755 "$checks_target" || exit $?

# Remove old checks, if they exist
rm -f "$checks_target"/* || exit $?

# Install new checks
install -p -m 0644 "$checks_src"/* "$checks_target" || exit $?

exit 0
