34 lines
1.0 KiB
Bash
34 lines
1.0 KiB
Bash
#!/bin/bash
|
|
# Script to run Zwift monitor locally with proper configuration
|
|
|
|
# Check if credentials are set
|
|
if [ -z "$ZWIFT_USERNAME" ] || [ -z "$ZWIFT_PASSWORD" ]; then
|
|
echo "Error: ZWIFT_USERNAME and ZWIFT_PASSWORD must be set"
|
|
echo ""
|
|
echo "Usage:"
|
|
echo " export ZWIFT_USERNAME=your@email.com"
|
|
echo " export ZWIFT_PASSWORD=yourpassword"
|
|
echo " ./run-local.sh"
|
|
exit 1
|
|
fi
|
|
|
|
# Set local paths (relative to current directory)
|
|
export ZWIFT_OUTPUT_DIR="$(pwd)/data/activities"
|
|
export ZWIFT_STATE_FILE="$(pwd)/data/zwift-state.json"
|
|
export ZWIFT_TOKEN_CACHE="$(pwd)/data/.zwift-token.json"
|
|
export ZWIFT_LOG_LEVEL="${ZWIFT_LOG_LEVEL:-info}"
|
|
export ZWIFT_POLL_INTERVAL="${ZWIFT_POLL_INTERVAL:-5m}"
|
|
|
|
# Create data directory if it doesn't exist
|
|
mkdir -p "$ZWIFT_OUTPUT_DIR"
|
|
|
|
echo "Starting Zwift Activity Monitor..."
|
|
echo "Output directory: $ZWIFT_OUTPUT_DIR"
|
|
echo "State file: $ZWIFT_STATE_FILE"
|
|
echo "Log level: $ZWIFT_LOG_LEVEL"
|
|
echo "Poll interval: $ZWIFT_POLL_INTERVAL"
|
|
echo ""
|
|
|
|
# Run the monitor
|
|
./zwift-monitor
|