1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-14 07:43:06 +00:00
freebsd-ports/net-mgmt/netdisco/pkg-deinstall
Olli Hauer 8d8626737f - update netdisco to version 1.0
- pass mainership to submitter

PR:		151841
Submitted by:	Sevan Janiyan <venture37 _at_ geeklan.co.uk> (new maintainer)
Approved by:	glarkin (mentor, implicit)
2010-11-07 19:47:04 +00:00

49 lines
1003 B
Bash

#!/bin/sh
if [ x"$2" != x"POST-DEINSTALL" ]; then
exit 0
fi
TMPDIR=${TMPDIR:=/tmp}
PKG_TMPDIR=${PKG_TMPDIR:=${TMPDIR}}
apxscmd=${PKG_PREFIX}/sbin/apxs
tmpdir=${PKG_TMPDIR}/deinst_netdisco.$$
if [ ! -x ${apxscmd} ]; then
echo Can\'t find the apxs program: ${apxscmd}.
exit 1
fi
confdir=`${apxscmd} -q SYSCONFDIR`
if [ ! -d ${confdir} ]; then
echo Can\'t find Apache conf dir: ${confdir}
exit 1
fi
if [ -f ${confdir}/httpd.conf ]; then
conffile=httpd.conf
fi
if [ -z "${conffile}" ]; then
echo Can\'t find ${confdir}/httpd.conf
exit 1
fi
if ! mkdir ${tmpdir}; then
echo Can\'t create temporary directory: ${tmpdir}
exit 1
fi
for i in ${conffile}; do
awk '{if (!/^# Netdisco include file[s]/ && !/^Include.*netdisco_apache.*\.conf/) \
print $0}' < ${confdir}/$i > ${tmpdir}/$i
echo Updating $i in config dir: ${confdir}
cat ${tmpdir}/$i > ${confdir}/$i
done
rm -Rf ${tmpdir}
exit 0