#!/usr/bin/env bash set -euo pipefail repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" env_file="$repo_root/.env.agent" example_env_file="$repo_root/.env.agent.example" if [[ ! -f "$env_file" ]]; then cp "$example_env_file" "$env_file" fi # shellcheck disable=SC1091 source "$repo_root/scripts/lib/runtime-env.sh" mkdir -p "$BETTERNAS_EXPORT_PATH" if [[ ! -f "$BETTERNAS_EXPORT_PATH/README.txt" ]]; then cat >"$BETTERNAS_EXPORT_PATH/README.txt" <