#!/usr/bin/env bash
# This file is in the public domain.
#
# Like cat.sh, but only for the first challenge: every later invocation
# fails without delivering anything, simulating an SMS/e-mail gateway
# that went down between two PIN transmissions.
TARGET="$(echo $1 | jq -r ".filename")"
if [ -e "${TARGET}.sent" ]
then
    exit 1
fi
touch "${TARGET}.sent"
cat - > "${TARGET}"
exit 0
