#!/bin/bash
ASSET="${1:?usage: v16_run.sh <asset> <window> [--live]}"
WINDOW="${2:?usage: v16_run.sh <asset> <window>}"
shift 2
cd /var/www/html/Poly/V16 || exit 1
while true; do
    echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting V16 ${ASSET} ${WINDOW}m $*"
    python3 -m v16.main --asset "$ASSET" --window "$WINDOW" "$@"
    echo "[$(date '+%Y-%m-%d %H:%M:%S')] Restarting in 5s..."
    sleep 5
done
