aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/netxms/files/pkg-deinstall.in
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/netxms/files/pkg-deinstall.in')
-rw-r--r--net-mgmt/netxms/files/pkg-deinstall.in35
1 files changed, 35 insertions, 0 deletions
diff --git a/net-mgmt/netxms/files/pkg-deinstall.in b/net-mgmt/netxms/files/pkg-deinstall.in
new file mode 100644
index 000000000000..f2bcd396c9a6
--- /dev/null
+++ b/net-mgmt/netxms/files/pkg-deinstall.in
@@ -0,0 +1,35 @@
+#! /bin/sh
+
+# $FreeBSD$
+
+PATH=/bin:/usr/sbin
+TSHOME=${PKG_PREFIX}/share/netxms
+
+USER=netxms
+GROUP=${USER}
+
+case "$2" in
+POST-DEINSTALL)
+ if pw group show "${GROUP}" 2>/dev/null; then
+ if pw groupdel ${GROUP}; then
+ echo "Removed group \"${GROUP}\"."
+ else
+ echo "Removing group \"${GROUP}\" failed..."
+ exit 1
+ fi
+ else
+ echo "Group \"${GROUP}\" doesn't exist!"
+ fi
+
+ if pw user show "${USER}" 2>/dev/null; then
+ if pw userdel ${USER}; then
+ echo "Removed user \"${USER}\"."
+ else
+ echo "Removing user \"${USER}\" failed..."
+ exit 1
+ fi
+ else
+ echo "User \"${USER}\" doesn't exist!"
+ fi
+ ;;
+esac