From e5925cd22ef16a563ffd18374baf0b2f009db01c Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Thu, 24 Apr 2003 20:19:31 +0000 Subject: Add patches to prevent multibyte encoded strings to be garbaged. (already submitted to the author) Add user & group in package building too. Submitted by: bento Remove user & group on deinstallation (only on bento). --- irc/dancer-services/pkg-deinstall | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 irc/dancer-services/pkg-deinstall (limited to 'irc/dancer-services/pkg-deinstall') diff --git a/irc/dancer-services/pkg-deinstall b/irc/dancer-services/pkg-deinstall new file mode 100644 index 000000000000..307194a2da88 --- /dev/null +++ b/irc/dancer-services/pkg-deinstall @@ -0,0 +1,56 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +ask() { + local question default answer + + question=$1 + default=$2 + if [ -z "$BATCH" ]; then + read -p "${question} [${default}]? " answer + fi + if [ x${answer} = x ]; then + answer=${default} + fi + echo ${answer} +} + +yesno() { + local dflt question answer + + question=$1 + dflt=$2 + while :; do + answer=$(ask "${question}" "${dflt}") + case "${answer}" in + [Yy]*) return 0;; + [Nn]*) return 1;; + esac + echo "Please answer yes or no." + done +} + +delete_account() { + local u g + + u=$1 + g=$2 + if yesno "Do you want me to remove group \"${g}\"" y; then + pw groupdel -n ${g} + echo "Done." + fi + if yesno "Do you want me to remove user \"${u}\"" y; then + pw userdel -n ${u} + echo "Done." + fi +} + +if [ "$2" != "POST-DEINSTALL" ]; then + exit 0 +fi + +if [ -n "$PACKAGE_BUILDING" ]; then + delete_account ircservices ircservices +fi -- cgit v1.2.3