403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/champ-os/current/scripts/deploy/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/champ-os/current/scripts/deploy/health-check.sh
#!/usr/bin/env bash
#
# Standalone health check script for deployment verification.
#
# Usage:
#   ./scripts/deploy/health-check.sh [URL] [TIMEOUT] [RETRIES]
#
# Arguments:
#   URL      Health endpoint URL (default: https://api.distill.philiprehberger.com/v1/healthz)
#   TIMEOUT  Request timeout in seconds (default: 30)
#   RETRIES  Number of retry attempts (default: 3)
#
# Exit codes:
#   0  Application is healthy
#   1  Application is unhealthy or unreachable

set -euo pipefail

URL="${1:-https://api.distill.philiprehberger.com/v1/healthz}"
TIMEOUT="${2:-30}"
RETRIES="${3:-3}"
DELAY=5

echo "Health check: ${URL}"
echo "Timeout: ${TIMEOUT}s | Retries: ${RETRIES} | Delay: ${DELAY}s"

for attempt in $(seq 1 "${RETRIES}"); do
    echo -n "Attempt ${attempt}/${RETRIES}... "

    response=$(curl -sf --max-time "${TIMEOUT}" "${URL}" 2>/dev/null || true)

    if echo "${response}" | grep -q '"healthy"'; then
        echo "HEALTHY"
        echo "${response}" | python3 -m json.tool 2>/dev/null || echo "${response}"
        exit 0
    fi

    echo "FAILED"

    if [ "${attempt}" -lt "${RETRIES}" ]; then
        echo "Retrying in ${DELAY}s..."
        sleep "${DELAY}"
    fi
done

echo ""
echo "ERROR: Health check failed after ${RETRIES} attempts."
echo "Verify manually: ${URL}"
exit 1

Youez - 2016 - github.com/yon3zu
LinuXploit