1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-21 04:06:46 +00:00
freebsd-ports/sysutils/bacula-server/pkg-deinstall.client
Lars Koeller daff0ed748 o) Don't report deinstall message (manually deletion of directory)
if it's useless, i.e. the dir could be removed automatically.

Submitted by:	 Kris Kennaway <kris@obsecurity.org>
2004-12-13 18:28:29 +00:00

25 lines
570 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
;;
esac