#!/bin/sh # Usable right now? One short GET against the endpoint's own model list. # Exit 0 = yes. Anything else = not now, and the reason goes to stdout. url="${JUNCTION_BASE%/}/models" code=$(curl -s -o /dev/null -m 5 -w '%{http_code}' "$url" 2>/dev/null) || { echo "no_answer_from_${JUNCTION_BACKEND}"; exit 1 } case "$code" in 2*) exit 0 ;; *) echo "http_${code}_from_${JUNCTION_BACKEND}"; exit 1 ;; esac