#!/bin/sh
set -eu
# exit code is useless, we need to parse for "not ok"
OUT=$(su -c 'PGDATABASE=test PGUSER=postgres perl test.pl' postgres)
echo "$OUT"
if echo "$OUT" | grep -q 'not ok'; then
    echo "FAILED" >&2
    exit 1
fi
