#!/bin/bash

# The job of this script is to make setman to create
# a backup copy of the configuration file

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

# Add backup configuration file
cat "${JSON_CONFIG_PATH}" | setman-backup "remoteLogToolSetSettings" "${JSON_CONFIG_FILE}"

exit_code="${?}"

if [ "${exit_code}" -ne 0 ]; then
    setman-log error "'${JSON_CONFIG_FILE}' backup failed"
fi

exit "${exit_code}"
