#!/usr/bin/env bash set -euo pipefail repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" env_file="$repo_root/.env.agent" if [[ ! -f "$env_file" ]]; then # shellcheck disable=SC1091 source "$repo_root/scripts/lib/agent-env.sh" betternas_write_agent_env_file "$env_file" "$repo_root" 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" <