#!/bin/sh

MOTD_FILE="$AUTOPKGTEST_TMP/motd"

echo "Example of message of the day" > "$MOTD_FILE"

xmotd "$MOTD_FILE" | grep "day$"

if [ "$?" -eq 0 ]; then
   lines=$(xmotd "$MOTD_FILE" | wc -l)

   [ $lines -eq 0 ] && exit 0
fi

exit 1
