1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-25 04:43:33 +00:00
freebsd-ports/net-mgmt/netdisco/pkg-deinstall
Raphael Kubo da Costa 5449bb6104 - Update to 1.2.
- Removed option to fetch oui.txt while building the port (let the user read
  pkg-message).

PR:		ports/177956
Submitted by:	Geoffroy Desvernay <dgeo@centrale-marseille.fr> (maintainer)
2013-06-13 11:43:07 +00:00

50 lines
1.0 KiB
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}.
echo Don\'t forget to update apache config manually
exit 0
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