freebsd-ports/sysutils/bacula-server/pkg-deinstall
Lars Koeller 47e504a16d o) Fix a bug concerning the creation of /var/db/bacula and chmod
in pkg-install in pre-install phase (wrong order).
o) Add/delete lines for file, storage and director ports in /etc/services
o) Add bacula patches concerning EOM handling, choosing the next volume, and
   calculating weekofmonth
2004-01-12 19:56:23 +00:00

26 lines
727 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
# 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}'"
echo "Check if ${BACULA_DIR} is empty and delete it to permanently remove the port"
fi
;;
esac