#!/bin/sh
# Stands in for the journal. `-f` follows forever on a real robot; here it emits
# a few lines and exits, so a test can assert what was asked for without hanging
# on something designed never to end.
echo "$@" >> /tmp/journalctl.log
unit=""
while [ $# -gt 0 ]; do
  case "$1" in
    -u) unit="$2"; shift 2 ;;
    *)  shift ;;
  esac
done
if [ "$unit" != "tnkr-robot" ]; then
  echo "-- No entries --"
  exit 1
fi
echo "Aug 17 06:00:01 duck tnkr-robot[421]: server listening on 0.0.0.0:8000"
echo "Aug 17 06:00:02 duck tnkr-robot[421]: ready"
exit 0
