#!/bin/sh

# /etc/cron.daily/noris-apt
# This script informs you about available updates. It performs a simple
# ordering simulation.
# See the apt-get(8), sources.list(5) and apt.conf(5) manual
# pages for more information and options.
# Written by Hardy Kestin <hardy@noris.net>
PATH=/usr/bin:/bin:/usr/sbin:/sbin
HOST=`hostname -f`
RCPT="apt-update"

if apt-get update -qq > /dev/null 2>&1; then
	apt-get dist-upgrade -qqs 2>&1 | grep -v Conf | mail -e -s "Update info for $HOST" "$RCPT"
else
	apt-get update -qq 2>&1 | mail -e -s "Update Problem for $HOST" "$RCPT"
fi

exit 0
