summaryrefslogtreecommitdiffstats
path: root/sysutils/bacula-server-devel/pkg-deinstall
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/bacula-server-devel/pkg-deinstall')
-rw-r--r--sysutils/bacula-server-devel/pkg-deinstall32
1 files changed, 32 insertions, 0 deletions
diff --git a/sysutils/bacula-server-devel/pkg-deinstall b/sysutils/bacula-server-devel/pkg-deinstall
new file mode 100644
index 0000000..3af0615
--- /dev/null
+++ b/sysutils/bacula-server-devel/pkg-deinstall
@@ -0,0 +1,32 @@
+#!/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
OpenPOWER on IntegriCloud