#!/bin/bash

DIR=/tmp/ledgerd
COSI=$DIR/$REMOTE_USER.cosi
CISO=$DIR/$REMOTE_USER.ciso

echo "Content-Type: text/plain; charset=utf-8"

if [[ ! -p $COSI ]]; then
	echo "Status: 404 Not Found"
	echo ""
	echo "ledgerd not running for $REMOTE_USER"
	exit 0
fi

echo ""
echo "$QUERY_STRING" 2>&1 >$COSI
cat $CISO

