#!/bin/sh
# Tool: check_app_status
# Checks HTTP status of mysportmanager.ofsoftware.ie

URL="https://mysportmanager.ofsoftware.ie"

# Perform curl request with timing
result=$(curl -s -o /dev/null -w "%{http_code} %{time_total}" --max-time 10 "$URL" 2>/dev/null)

if [ $? -eq 0 ]; then
	http_code=$(echo $result | awk '{print $1}')
	response_time=$(echo $result | awk '{print $2}')
	echo "Status: $http_code | Response Time: ${response_time}s"
	exit 0
else
	echo "Status: ERROR | Failed to reach $URL"
	exit 1
fi
