#!/bin/sh

set -e

debian/tests/wait-for-apt-update-to-finish

# generate and show MOTD
update-motd

# check if there are not tested snippets
# mythtv status is buggy
apt-file update
for i in $(apt-file search /etc/update-motd.d | grep -v mythtv-status | cut -d' ' -f2); do
    if ! [ -f $i ]; then
        echo "ERROR: Untested update-motd snippet: $(apt-file search $i): $i" >&2
    fi
done
