#!/bin/sh # On a Debian machine, list any updated packages that need installing. hostname="`hostname -s`" # If you aren't me, then you MUST change this line! notify="ats-dcu-$hostname@offog.org.CHANGEME" apt-get -qq update outfile=/tmp/debian-check-updates.$$ trap "rm -f $outfile" 0 exec >$outfile need_banner=true apt-get -qqs dist-upgrade | sort | while read s p ; do if [ "$s" = "Inst" ] ; then if $need_banner ; then echo "debian-check-updates on `hostname` at `date`" echo echo "The following packages need installing:" echo need_banner=false fi echo "$p" fi done if [ -s $outfile ] ; then mailx -s "debian-check-updates $hostname" "$notify" <$outfile fi