Files
ports/sysutils/dtc/files/dtc-deinstall.in
Clement Laforet 302c3bd329 Add dtc 0.12.0.6, a hosting web GUI for admin and accounting
apache/named/proftpd/qmail.

A hosting web GUI for admin and accounting apache/named/proftpd/qmail
Domain Technologie Control (DTC) is a set of PHP scripts and a web
interface that manage a MySQL database that handles all the host
information. It generates backup scripts, statistic calculation scripts,
andconfig files for bind, Apache, qmail, and proftpd, using a single system
UID/GID. With DTC, you can delegate the task of creating subdomains,
email,and FTP accounts to users for the domain names they own, and monitor
bandwidth per user and service.

WWW: http://www.gplhost.com/?rub=software&sousrub=dtc

PR:		ports/65593
Submitted by:	Frederic Cambus & Thomas Goirand
2004-05-25 00:54:02 +00:00

110 lines
3.6 KiB
Bash

#!/bin/sh
# Tarball uninstall sh script for DTC
# Written by Thomas GOIRAND <thomas@goirand.fr>
# under LGPL Licence
UNIX_TYPE=freebsd
PREFIX=%%PREFIX%%
LOCALBASE=%%LOCALBASE%%
QMAIL_DIR=%%QMAIL_DIR%%
echo "### DEAMON PATH CONFIGURATION ###"
PATH_HTTPD_CONF="${LOCALBASE}/etc/apache/httpd.conf"
PATH_NAMED_CONF="/etc/namedb/named.conf"
PATH_PROFTPD_CONF="${LOCALBASE}/etc/proftpd.conf"
PATH_QMAIL_CTRL="${QMAIL_DIR}/control"
# Multi OS (Unix system) uninstall sh script for DTC
# Written by Thomas GOIRAND <thomas@goirand.fr>
# under LGPL Licence
# The configuration for all thoses variables must be written BEFORE this
# script. Do the start of the script for your operating system.
# I did mine for debian in debian/postinst
# Please note this script
# doeas not start with a :
#!/bin/sh
# because it's up to you to write it ! :)
# Do a "cat uninstall_deamons.sh >> your_OS_vars_setup_script.sh"
#
# uninstall named.conf
#
if grep "Configured by DTC" $PATH_NAMED_CONF
then
echo "===> Uninstalling inclusion from named.conf"
grep -v "Configured by DTC" $PATH_NAMED_CONF >/tmp/dtc_uninstall.named.conf
grep -v "include \"$PATH_DTC_ETC/named.conf\"" /tmp/dtc_uninstall.named.conf >/tmp/dtc_uninstall2.named.conf
cp -f $PATH_NAMED_CONF $PATH_NAMED_CONF.DTC.removed
mv /tmp/dtc_uninstall2.named.conf $PATH_NAMED_CONF
rm -f /tmp/dtc_uninstall.named.conf
fi
#
# uninstall httpd.conf
#
if grep "Configured by DTC" $PATH_HTTPD_CONF
then
echo "===> Uninstalling inclusion from httpd.conf"
if grep "Configured by DTC v0.10" $PATH_HTTPD_CONF >/dev/null 2>&1
then
grep -v "Configured by DTC" $PATH_HTTPD_CONF | grep -v "Include $PATH_DTC_ETC/vhosts.conf" >/tmp/dtc_uninstall.httpd.conf
cp -f $PATH_HTTPD_CONF $PATH_HTTPD_CONF.DTC.removed
mv /tmp/dtc_uninstall.httpd.conf $PATH_HTTPD_CONF
else
start_line=`grep -n "Configured by DTC" $PATH_HTTPD_CONF | cut -d":" -f1`
end_line=`grep -n "End of DTC configuration" $PATH_HTTPD_CONF| cut -d":" -f1`
nbr_line=`cat $PATH_HTTPD_CONF | wc -l`
cat $PATH_HTTPD_CONF | head -n $(($start_line - 1 )) >/tmp/DTC_uninstall.httpd.conf
cat $PATH_HTTPD_CONF | tail -n $(($nbr_line - $end_line )) >>/tmp/DTC_uninstall.httpd.conf
cat </tmp/DTC_uninstall.httpd.conf >$PATH_HTTPD_CONF
fi
fi
#
# uninstall proftpd.conf
#
echo "===> Uninstalling inclusion from proftpd.conf"
if grep "Configured by DTC" $PATH_PROFTPD_CONF
then
start_line=`grep -n "Configured by DTC" $PATH_PROFTPD_CONF | cut -d":" -f1`
end_line=`grep -n "End of DTC configuration" $PATH_PROFTPD_CONF| cut -d":" -f1`
nbr_line=`cat $PATH_PROFTPD_CONF | wc -l`
cat $PATH_PROFTPD_CONF | head -n $(($start_line - 1 )) >/tmp/DTC_uninstall.profptd.conf
cat $PATH_PROFTPD_CONF | tail -n $(($nbr_line - $end_line )) >>/tmp/DTC_uninstall.profptd.conf
cp -f $PATH_PROFTPD_CONF $PATH_PROFTPD_CONF.DTC.removed
mv /tmp/DTC_uninstall.profptd.conf $PATH_PROFTPD_CONF
fi
#
# Uninstall qmail
#
echo "===> Uninstalling from qmail"
#if ! [ -f $PATH_QMAIL_CTRL/rcpthosts.DTC.backup ] ; then
# rm -f $PATH_QMAIL_CTRL/rcpthosts
# mv -f $PATH_QMAIL_CTRL/rcpthosts.DTC.backup $PATH_QMAIL_CTRL/rcpthosts
#fi
if ! [ -f $PATH_QMAIL_CTRL/virtualdomains.DTC.backup ] ; then
rm -f $PATH_QMAIL_CTRL/virtualdomains.DTC.backup
mv -f $PATH_QMAIL_CTRL/virtualdomains.DTC.backup $PATH_QMAIL_CTRL/virtualdomains
fi
#if ! [ -f $PATH_QMAIL_CTRL/users/assign.DTC.backup ] ; then
# rm -f $PATH_QMAIL_CTRL/users/assign.DTC.backup
# mv -f $PATH_QMAIL_CTRL/users/assign.DTC.backup $PATH_QMAIL_CTRL/users/assign
#fi
if ! [ -f /etc/poppasswd.DTC.backup ] ; then
rm -f /etc/poppasswd.DTC.backup
mv -f/etc/poppasswd.DTC.backup /etc/poppasswd
fi