#!/bin/sh

config_file () {
    local NEW="$1.new"
    [ -f "$NEW" ] || { echo "$NEW does not exist!"; return; }

    if [ -f "$1" ] ; then
	if cmp -s "$1" "$NEW" ; then
	    rm "$NEW"
	else
	    echo
	    echo "You might want to check $NEW"
	    echo
	fi
    else
	mv $NEW $1
    fi
}


/usr/sbin/useradd -u 15 -d /var/www -s /bin/false \
    -c httpd httpd 2> /dev/null

config_file etc/thttpd.conf
config_file etc/rc.d/rc.thttpd

# Don't bother if index.html exists
if [ -f var/www/html/index.html ] ; then
    rm var/www/html/index.html.new
else
    mv var/www/html/index.html.new var/www/html/index.html
fi
