#!/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 -A | sed -e 's/ .*//')
RCPT="server-update@smurf.noris.de"

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

exit 0
