30 lines
753 B
Bash
Executable File
30 lines
753 B
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
set -eu
|
|
|
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
|
|
if ! command -v python3 >/dev/null 2>&1; then
|
|
printf 'Error: python3 is required.\n' >&2
|
|
exit 1
|
|
fi
|
|
|
|
if ! command -v ffmpeg >/dev/null 2>&1; then
|
|
printf 'Error: ffmpeg is required for rendering.\n' >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ -f "$SCRIPT_DIR/.env" ]; then
|
|
set -a
|
|
# shellcheck disable=SC1091
|
|
. "$SCRIPT_DIR/.env"
|
|
set +a
|
|
fi
|
|
|
|
export MOONRAKER_URL=${MOONRAKER_URL:-http://192.168.1.13}
|
|
export CAMERA_SNAPSHOT_URL=${CAMERA_SNAPSHOT_URL:-http://192.168.1.13/webcam/?action=snapshot}
|
|
export CAMERA_STREAM_URL=${CAMERA_STREAM_URL:-http://192.168.1.13/webcam/?action=stream}
|
|
export OUTPUT_DIR=${OUTPUT_DIR:-"$SCRIPT_DIR/timelapses"}
|
|
|
|
cd "$SCRIPT_DIR"
|
|
exec python3 app.py |