#!/bin/bash

# This script's job is to validate the config file
# for the remote log toolset
# If anything goes wrong setman will call the
# script in the file named 'default'

# Get the necessary file paths variables from 'paths.sh'
source "custom/paths.sh"

# Run script in 'json-validator.sh' to validate the config file
"${VALIDATOR}"

# Get return code from the script
validator_result_code="${?}"

if [[ "${validator_result_code}" -ne 0 ]]; then
    setman-log error "Error during remote log toolset config validation: '${validator_result_code}'"
fi

# Exit with the result code, O only if there was no error
exit "${validator_result_code}"
