homeassistant-addons/screenshotter/rootfs/etc/services.d/screenshotter/run

19 lines
679 B
Text

#!/usr/bin/with-contenv bashio
bashio::log.info "Reading config..."
CONFIG_PATH=/data/options.json
export SCREEN_IMAGE_PATH="$(bashio::config 'image_path')"
export SCREEN_CONFIG="$(bashio::config 'config_file')"
export SCREEN_WIDTH="$(bashio::config 'width')"
export SCREEN_HEIGHT="$(bashio::config 'height')"
export SCREEN_ROTATE="$(bashio::config 'rotate')"
export SCREEN_WAIT="$(bashio::config 'wait_seconds')"
export SCREEN_HA_URL="$(bashio::config 'ha_url')"
export SCREEN_HA_TOKEN="$(bashio::config 'ha_token')"
export SCREEN_HA_LANGUAGE="$(bashio::config 'ha_language')"
mkdir -p $SCREEN_IMAGE_PATH
bashio::log.info "Starting screenshotter..."
exec python /app/app.py