#!/usr/bin/env bash
# Manual bench stop + sync (one command from ~/EtherGold/sync).
#
# Usage:
#   cd ~/EtherGold/sync
#   bash stop_and_sync_bench.sh

if grep -q $'\r' "${BASH_SOURCE[0]}" 2>/dev/null; then
  sed -i 's/\r$//' "${BASH_SOURCE[0]}"
  exec bash "${BASH_SOURCE[0]}" "$@"
fi

set -euo pipefail

SYNC="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "=== stop_and_sync_bench ==="
bash "${SYNC}/stop_fixture_gremlins.sh" 2>/dev/null || true
bash "${SYNC}/stop_fixture_session.sh"
echo "=== done — check Dropbox landing under 4-Board Test Fixture/N/ ==="
