#!/bin/bash # Start the file watcher for automatic uploads # Usage: ./start-watcher.sh [optional-watch-directory] # Get the directory where this script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PROJECT_DIR="$(dirname "$SCRIPT_DIR")" # Change to project directory to ensure .env is found cd "$PROJECT_DIR" # Use venv if it exists, otherwise use system python if [ -d "venv" ]; then PYTHON="venv/bin/python" else PYTHON="python3" fi # Run the file watcher if [ $# -eq 0 ]; then # No arguments - use OBS_RECORDING_DIR from .env $PYTHON -m obs_uploader.file_watcher else # Use provided directory $PYTHON -m obs_uploader.file_watcher "$1" fi