#!/bin/sh URL="http://localhost:3000/health" while true; do timestamp=$(date +"%H:%M:%S %d/%m/%Y") output=$(curl -s -o /dev/null -w "%{http_code} %{time_total}" "$URL") status_code=$(printf '%s' "$output" | awk '{print $1}') response_time=$(printf '%s' "$output" | awk '{print $2}') if [ "$status_code" = "200" ]; then status="UP" else status="DOWN" fi printf '%s | %s | %ss\n' "$timestamp" "$status" "$response_time" sleep 30 done