#!/bin/sh

printf "Content-type: application/json\n"
printf "\n"

printf '{"hostname": "%s", "uptime": "%s", "since": "%s", "users": "%s"}\n' \
    "$(hostname)" \
    "$(uptime | sed -e "s/.* up *//" -e "s/ *days, */d/" -e "s/:/h/" -e "s/,.*/m/")" \
    "$(uptime -s)" \
    "$(online-users)"

exit 0

