freebsd-ports/sysutils/bacula5-server/files/pkg-deinstall.client.in
Dan Langille 142fb20052 * ETCDIR should be chgrp bacula so the configuration files can be be read by
scripts.

While here:

* fix creation and deletion of /var/db/bacula to avoid error message
  on pkg delete and on removal of just the bacula-dir port.
* Change MAINTAINER to @FreeBSD.org address

PR:           196017
Submitted by: timp87@gmail.com
Approved by:  mat (mentor)
2014-12-21 21:55:49 +00:00

30 lines
717 B
Bash

#!/bin/sh
PATH=/bin:/usr/bin:/usr/sbin
# Note how to delete UID/GID
USER=%%BACULA_USER%%
GROUP=%%BACULA_GROUP%%
UID=%%BACULA_UID%%
GID=%%BACULA_UID%%
BACULA_DIR=%%BACULA_DIR%%
TMPFILE=/tmp/services-$RANDOM-$$
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
echo "Check if ${BACULA_DIR} is empty and delete it to permanently remove the bacula port."
fi
if pw groupshow "${USER}" 2>/dev/null 1>&2; then
echo "To delete Bacula group permanently, use 'pw groupdel ${GROUP}'"
fi
;;
esac