33
run-local.sh
Normal file
33
run-local.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user