#!/usr/bin/env bash set -euo pipefail usage() { cat <<'EOF' Usage: run_on_board.sh --host --user --build-dir Copies build artifacts (pass the install directory for best results) to the RK3588 board and runs sanity commands. EOF } HOST="" USER="root" BUILD_DIR="build/rk3588" while [[ $# -gt 0 ]]; do case "$1" in --host) HOST="$2"; shift 2;; --user) USER="$2"; shift 2;; --build-dir) BUILD_DIR="$2"; shift 2;; -h|--help) usage; exit 0;; *) echo "Unknown arg: $1" >&2 usage; exit 1;; esac done if [[ -z "$HOST" ]]; then echo "--host is required" >&2 exit 1 fi ARTIFACT_DIR="$BUILD_DIR" if [[ ! -d "$ARTIFACT_DIR" ]]; then echo "Build directory $ARTIFACT_DIR not found" >&2 exit 1 fi REMOTE_DIR="/tmp/safesight_media" scp -r "$ARTIFACT_DIR" "$USER@$HOST:$REMOTE_DIR" ssh "$USER@$HOST" <