#! /bin/sh # Debian update check script. report_address="some@your.mail-address.hoge " tmpfile_prefix=ducs LC_ALL=C export LC_ALL LANG=C export LANG rm -f /tmp/"$tmpfile_prefix"-??????-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] date=`date --iso-8601` tmpfile=`tempfile --directory /tmp --prefix "$tmpfile_prefix"- --suffix "-$date" --mode 600` apt-get update --quiet --quiet apt-get dist-upgrade --quiet --quiet --download-only --yes apt-get dist-upgrade --simulate \ | tee "$tmpfile" \ | egrep --quiet "^0 (packages|upgraded)" \ || mail -s apt-get-`hostname` $report_address < "$tmpfile" chmod 400 "$tmpfile" # rm -f "$tmpfile" # revision: $Id: check-update.txt,v 1.3 2004/08/17 07:23:04 yuya Exp $ # http://www.j96.org/~yuya/