#!/bin/bash
# $Header: /cvs/WebShield/wsrc/ui/uiconf/unconfig_ui,v 1.12 2004/02/02 14:19:54 bwhittak Exp $
# Unconfigure webserver for WebShield administration GUI

if [ -f $NETAWSS/.profile.vars ]; then 
 . $NETAWSS/.profile.vars 
elif [ -f /var/NAIENV/.profile.vars ]; then
 . /var/NAIENV/.profile.vars 
fi 
PATH=$wsPATH:$PATH
shopt -s extglob
exec </dev/null		# whatever stdin is we don't want it

# change to the directory where our files live
if [[ -d $NETAWSS/ui/uiconf ]]; then
    cd $NETAWSS/ui/uiconf
else
    echo "$0: $NETAWSS/ui/uiconf: not a directory!" >&2
fi

files='
/etc/httpd/conf/httpd.conf
/etc/httpd/conf/ssl.crt/server.crt
/etc/httpd/conf/ssl.key/server.key
/etc/httpd/conf.d/ssl.conf
/usr/share/ssl/openssl.cnf
'

# restore files from before our install
for f in $files; do
    lf=${f##*/};
    if [[ -f $lf.rpmsave ]]; then
	mv $lf.rpmsave $f
    fi
done

# remove the NAI-MIB.txt download link
rm -f "$UISTATIC/NAI-MIB.txt"

exit 0
