#! /bin/sh . `dirname $0`/../config.sh # Test whether all required packages are installed and generate a mail # if they aren't, so that the admin is informed. required="git-core gettext locales rsync dpkg-dev procmail" required="$required libcompress-zlib-perl" required="$required libhtml-parser-perl libio-stringy-perl" required="$required liblocale-gettext-perl libmldbm-perl" required="$required libtext-iconv-perl libhtml-template-perl" required="$required libclass-accessor-perl" required="$required liburi-perl libxml-rss-perl" required="$required libtemplate-perl libi18n-acceptlanguage-perl" required="$required liblingua-stem-perl" locales="de_DE.UTF-8 en_US.UTF-8 nl_NL fr_FR.UTF-8 uk_UA.UTF-8" packages=`tempfile` locs=`tempfile` cache=`tempfile` trap "rm -f $packages $locs" INT EXIT for p in $required do if [ -z "$(dpkg -l $p|grep ^ii)" ] then echo "Package $p missing." >> $packages echo >> $packages fi done for l in $locales do if ! grep -q "^$l" /etc/locale.gen then echo "Locale $l missing." >> $locs echo >> $locs fi done if [ -n "$cachedir" ] then if [ ! -d "$cachedir" ] then echo "cachedir missing." >> $cache else perm=$(ls -ld "$cachedir" | perl -ne 'print "ok" if /^drwxrws--- \d+ www-data/') if [ -z "$perm" ] then echo "cachedir has wrong permissions." >> $cache echo "make sure it is writable by the web server." >> $cache fi fi fi if [ -s $packages -o -s $locs -o -s $cache ] then ( echo "Subject: Problem packages.debian.org on `hostname -s`" echo "To: ${admin_email}" echo echo "On host `hostname -f`" echo if [ -s $packages ] then echo "Missing packages:" echo cat $packages fi if [ -s $locs ] then echo "Missing locales:" echo cat $locs fi if [ -s $cache ] then echo "Problems with cachedir:" echo cat $cache fi ) | /usr/sbin/sendmail -t fi