mirror of
https://github.com/sstent/FitTrack_GarminSync.git
synced 2026-01-25 16:41:41 +00:00
feat: Implement Garmin sync, login improvements, and utility scripts
This commit is contained in:
29
get_sync_status.sh
Executable file
29
get_sync_status.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script retrieves the current status of a specific sync job.
|
||||
|
||||
# --- Configuration ---
|
||||
API_BASE_URL="http://localhost:8001" # Adjust if your API is running on a different host/port
|
||||
|
||||
# --- Argument Parsing ---
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <JOB_ID>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
JOB_ID="$1"
|
||||
|
||||
# --- Retrieve Sync Status ---
|
||||
echo "Retrieving sync status for Job ID: ${JOB_ID}"
|
||||
SYNC_STATUS_RESPONSE=$(curl -s "${API_BASE_URL}/api/sync/status/${JOB_ID}")
|
||||
|
||||
if [ -z "${SYNC_STATUS_RESPONSE}" ]; then
|
||||
echo "Error: No response received from the API. Is the backend service running?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "${SYNC_STATUS_RESPONSE}"
|
||||
|
||||
# Optional: Add more robust parsing and display of status if needed
|
||||
# For example, using `jq` to pretty-print the JSON:
|
||||
# echo "${SYNC_STATUS_RESPONSE}" | jq .
|
||||
Reference in New Issue
Block a user