#!/usr/bin/env bash # Publish showcase clips to the droplet's clip vault (/var/lib/wizwar/clips). # The gallery at /clips serves whatever this ships: -fpv.mp4, # -board.mp4, .jpg per clip, described by clips.json. set -euo pipefail host=${1:?usage: clips-publish.sh } dir=${2:?usage: clips-publish.sh } test -f "$dir/clips.json" || { echo "no clips.json in $dir" >&2; exit 1; } ssh "root@$host" 'mkdir -p /var/lib/wizwar/clips' scp "$dir"/*.mp4 "$dir"/*.jpg "$dir/clips.json" "root@$host:/var/lib/wizwar/clips/" count=$(ls "$dir"/*-fpv.mp4 | wc -l | tr -d ' ') echo "published $count clips to $host"