1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-01 05:45:45 +00:00
freebsd-ports/sysutils/bacula-server/pkg-deinstall.server
Edwin Groothuis 165bc22b86 [MAINTAINER-UPDATE] sysutils/bacula-server - prepare master port for sysutils/bacula-bat
Alter this port in preparation for a new port, sysutils/bacula-bat
	No need to upgrade bacula-server unless you really want to.

PR:		ports/116449
Submitted by:	Dan Langille <dan@langille.org>
2007-09-24 03:05:51 +00:00

33 lines
831 B
Bash

#!/bin/sh
PATH=/bin:/usr/bin:/usr/sbin
TMPFILE=/tmp/services-$RANDOM-$$
if [ -z "${BACULA_DIR}" ]; then
BACULA_DIR=/var/db/bacula
fi
case "$2" in
"DEINSTALL")
# Delete entries in /etc/services
sed -e '/# Bacula port start/,/# Bacule port end/{' \
-e 'd' \
-e '}' /etc/services > $TMPFILE
mv -f $TMPFILE /etc/services
if [ -d ${BACULA_DIR} ]; then
rmdir ${BACULA_DIR};
fi
if [ -d ${BACULA_DIR} ]; then
echo "Check if ${BACULA_DIR} is empty and delete it to permanently remove the bacula port"
fi
# Note how to delete UID/GID
USER=bacula
GROUP=${USER}
if pw usershow "${USER}" 2>/dev/null 1>&2; then
echo "To delete Bacula user permanently, use 'pw userdel ${USER}'"
echo "To delete Bacula group permanently, use 'pw groupdel ${GROUP}'"
fi
;;
esac