#!/usr/bin/python3
# Compatibility script for old status_data_cgi.py requests
# Redirects to new /api/status endpoint

import requests
import json

print("Content-Type: application/json\n")

try:
    # Call the new status API on port 5050
    response = requests.get("http://localhost:5050/api/status", timeout=10)
    response.raise_for_status()
    data = response.json()
    print(json.dumps(data, indent=2))
except Exception as e:
    print(json.dumps({"error": f"Failed to fetch status data: {str(e)}"}, indent=2))