#!/bin/sh
# Healthy if state.json was written within the last 5 minutes.
python -c "
import os, time, sys
p = '/data/state.json'
if not os.path.exists(p):
    sys.exit(1)
age = time.time() - os.path.getmtime(p)
sys.exit(0 if age < 300 else 1)
"
