freebsd-ports/net-mgmt/noc/files/pkg-deinstall.in
Martin Wilke 3ba0c8634a - Update to 0.6
PR:		154418
Submitted by:	Stanislav A Svirid <count@211.ru> (maintainer)
Feature safe:	yes
2011-02-05 03:19:10 +00:00

28 lines
722 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
NOCDIR=%%NOCDIR%%
NOCDBDIR=%%NOCDBDIR%%
NOCUSER=%%NOCUSER%%
NOCGROUP=%%NOCGROUP%%
if [ "$2" = "POST-DEINSTALL" ]; then
if /usr/sbin/pw group show "${NOCGROUP}" 2>&1 >/dev/null; then
echo "You should manually remove the \"${NOCGROUP}\" group."
fi
if /usr/sbin/pw user show "${NOCUSER}" 2>&1 >/dev/null; then
echo "You should manually remove the \"${NOCUSER}\" user."
fi
##
## Remove created directories
##
for d in ${NOCDIR}/local ${NOCDIR}/static ${NOCDIR}/static/* ${NOCDIR} ${NOCDBDIR}/repo ${NOCDBDIR}/backup ${NOCDBDIR} /var/log/noc ${LOCALSTATE_DIR}; do
if [ -e $d ]; then
echo "You should manually remove the \"${d}\" directory."
fi
done
fi