#!/bin/sh
#
#	$Source: /mit/wwwdev/mkserv/RCS/web.del,v $
#	$Author: bert $
#	$Id: web.del,v 1.2 1995/10/23 17:40:39 bert Exp $
#	$Revision: 1.2 $
#
#	$Platforms: sun4,decmips $


# ${DATA} is a file that stores persistent installation information.
DATA="${CONFIGDIR}/mkserv.web"


# remove ${DATA}

if [ -r "${DATA}" ]; then
    . ${DATA}
    mv ${DATA} ${DATA}.deinstalled
fi

# remove auto-startup cruft

if [ -r /etc/athena/START_HTTPD ]; then
    rm -f /etc/athena/START_HTTPD
fi

for file in /etc/rc3.d/[SK][0-9][0-9]http; do
    if [ -r $file ]; then
	# rename S*http to s*http, etc. (rc stuff is case sensitive)
	mv -f $file `echo $file | sed -e 's#/S#/s#' -e 's#/K#/k#'`
    fi
done

# print a message

echo "===> Remove the web server install tree in ${WEBROOT}." >> $LOGFILE

### delete entry for www from /etc/{passwd,shadow}

#echo "deluser nohesiod www" >> ${CONFCNG}
echo "===> Remove user www from /etc/passwd* and /etc/shadow*" >> $LOGFILE

### delete entry for www from /etc/group.  Too bad there is no "delgroup".

#group=www
#for file in /etc/group /etc/group.local; do
#    if [ -w $file ]; then
#	grep -v "^${group}:" $file > ${file}.new
#	mv ${file}.new $file
#    fi
#done
echo "===> Remove group www from /etc/group*" >> $LOGFILE

exit 0
