#!/bin/bash
#
# postinst for dwww
# "@(#)dwww:$Id: postinst,v 1.9 1997/03/22 23:57:42 jim Exp $"
#

set -e

if [ "$1" = "configure" ]; then
	if [ -d /usr/doc -a ! -e /usr/doc/dwww -a -d /usr/share/doc/dwww ]; then
                ln -sf ../share/doc/dwww /usr/doc/dwww
        fi
fi

/usr/sbin/dwwwconfig --auto

if test ! -f /var/lib/dwww/html/index.html
then
	echo -n "Building dwww pages; this will take a while..."
	/etc/cron.daily/dwww
	echo " done."
fi

if test -x /usr/bin/update-menus ; then update-menus ; fi
