25 lines
685 B
Bash
Executable File
25 lines
685 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
repo_root="$(cd "${script_dir}/.." && pwd)"
|
|
|
|
template_path="${repo_root}/deploy/templates/qortal/default-node-settings.json"
|
|
target_dir="${repo_root}/qortal/data"
|
|
target_settings="${target_dir}/settings.json"
|
|
|
|
if [[ ! -f "${template_path}" ]]; then
|
|
echo "Missing template: ${template_path}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p "${target_dir}"
|
|
|
|
if [[ -f "${target_settings}" && -s "${target_settings}" ]]; then
|
|
echo "Using existing Qortal settings: ${target_settings}"
|
|
exit 0
|
|
fi
|
|
|
|
cp "${template_path}" "${target_settings}"
|
|
echo "Initialized Qortal settings from template: ${target_settings}"
|