#!/bin/bash

# The job of this script is to make setman to restore
# the backup copy of the configuration file
# In case of an error, setman will call the 'default' script

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

# Restore the previously saved backup file
setman-restore "remoteLogToolSetSettings" "${JSON_CONFIG_FILE}" >"${JSON_CONFIG_PATH}"

exit_code="${?}"

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

exit "${exit_code}"
