aboutsummaryrefslogtreecommitdiffstats
path: root/games/wolfpack
diff options
context:
space:
mode:
authorjohans <johans@FreeBSD.org>2007-04-02 00:36:47 +0800
committerjohans <johans@FreeBSD.org>2007-04-02 00:36:47 +0800
commit272c7af951115a556d18c17dd52dc2131064c64c (patch)
tree64de7fb20826336518a6a90bf4c4ea6d6195092f /games/wolfpack
parent618279f207d8687af409c29351dc81ced9e8e84e (diff)
downloadfreebsd-ports-gnome-272c7af951115a556d18c17dd52dc2131064c64c.tar.gz
freebsd-ports-gnome-272c7af951115a556d18c17dd52dc2131064c64c.tar.zst
freebsd-ports-gnome-272c7af951115a556d18c17dd52dc2131064c64c.zip
Add deinstall script to ensure proper cleanup when port is removed.
Reported by: krismail
Diffstat (limited to 'games/wolfpack')
-rw-r--r--games/wolfpack/pkg-deinstall41
1 files changed, 41 insertions, 0 deletions
diff --git a/games/wolfpack/pkg-deinstall b/games/wolfpack/pkg-deinstall
new file mode 100644
index 000000000000..6baf72fdb36f
--- /dev/null
+++ b/games/wolfpack/pkg-deinstall
@@ -0,0 +1,41 @@
+#! /bin/sh
+
+PATH=/bin:/usr/bin:/usr/sbin
+INSTDIR=${PKG_PREFIX}/share/wolfpack
+DATADIR=${PKG_PREFIX}/var/wolfpack
+CONFDIR=${PKG_PREFIX}/etc/wolfpack
+
+USER=wolfpack
+GROUP=${USER}
+
+case $2 in
+DEINSTALL)
+ if cmp -s ${CONFDIR}/econfig ${CONFDIR}/econfig.orig; then
+ rm -f ${CONFDIR}/econfig
+ fi
+ ;;
+
+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