#!/bin/sh
#
# SPDX-FileCopyrightText: SUSE LLC
# SPDX-License-Identifier: GPL-3.0-or-later
#
#  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_target="/usr/share/trento/checks"
checks_virtualroot="/virtualroot/${checks_target}"

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_virtualroot"/* "$checks_target" || exit $?

exit 0
