#!/bin/sh

# Script to check for updates
#

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin

apt-get update;apt-get -s upgrade > /tmp/apt-get.tmp

diff /tmp/apt-get.tmp /root/.scripts/.apt-get.reference > /tmp/apt-get.diff

UPGRADE=`cat /tmp/apt-get.diff | wc -l`
NUM=3

# if updates send email
if [ $NUM -lt $UPGRADE ]
then
        cat /tmp/apt-get.tmp | mailx -s "Updates Needed: `date +%k%Mhrs-%Y%m%d`" bob@dev.null
fi

exit 0


