1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#!/bin/sh
if test $# -lt 3 ; then
cat >> /dev/stderr <<EOF
Usage:
$0 <directory> <start_time> <details> ...
Print status.json on stdout.
EOF
exit 1
fi
bindir=$(cd $(dirname $0) && pwd)
directory=$1 ; shift
start_time=$1 ; shift
jq --null-input \
--arg details "$*" \
--arg directory "${directory}" \
--arg start_time "${start_time}" \
'
{}
| .current_time = (now|todateiso8601)
| .start_time = $start_time
| .directory = $directory
| .details = $details
'
|