head	1.3;
access;
symbols
	RELEASE_6_1_0:1.2
	RELEASE_5_5_0:1.2
	RELEASE_6_0_0:1.2
	RELEASE_5_4_0:1.1
	RELEASE_4_11_0:1.1
	RELEASE_5_3_0:1.1
	RELEASE_4_10_0:1.1
	RELEASE_5_2_1:1.1
	RELEASE_5_2_0:1.1
	RELEASE_4_9_0:1.1
	RELEASE_5_1_0:1.1
	RELEASE_4_8_0:1.1
	RELEASE_5_0_0:1.1
	RELEASE_4_7_0:1.1;
locks; strict;
comment	@# @;


1.3
date	2006.10.08.18.06.54;	author roam;	state dead;
branches;
next	1.2;

1.2
date	2005.06.05.23.03.15;	author flz;	state Exp;
branches;
next	1.1;

1.1
date	2002.09.20.09.29.10;	author roam;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Fix the problem with unattended deinstallation by not even attempting
to remove the stunnel user and group at all - just kill the package
deinstall script.

PR:		104028
Reported by:	jan grant <jan.grant@@bristol.ac.uk>,
		Stephen Hurd <shurd@@sasktel.net> (in private mail a while ago),
		and, I think, many others
@
text
@#! /bin/sh
#
# $FreeBSD: ports/security/stunnel/pkg-deinstall,v 1.2 2005/06/05 23:03:15 flz Exp $
# taken from net/cvsup-mirror

PATH=/bin:/usr/sbin

STUNNEL_USER=${STUNNEL_USER:-stunnel}
STUNNEL_GROUP=${STUNNEL_GROUP:-stunnel}

ask() {
    local question default answer

    question=$1
    default=$2
    if [ -z "${PACKAGE_BUILDING}" -a -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 home

    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
	eval home=~${u}
	pw userdel -n ${u}
	echo "Done."
	if [ -d "${home}" ]; then
	    echo "Please remember to remove the home directory \"${home}\""
	fi
    fi
}

if [ x$2 != xDEINSTALL ]; then
    exit
fi

delete_account ${STUNNEL_USER} ${STUNNEL_GROUP}
@


1.2
log
@- Fix deinstall script when running in BATCH mode.

PR:		ports/67762
Submitted by:	Linus Sjoberg <lsjoberg@@aland.net>
Approved by:	maintainer timeout (7 weeks)
@
text
@d3 1
a3 1
# $FreeBSD: ports/security/stunnel/pkg-deinstall,v 1.1 2002/09/20 09:29:10 roam Exp $
@


1.1
log
@Update to stunnel-4.00.

*** WARNING WARNING WARNING ***
The stunnel invocation has changed!  The program no longer accepts
command-line options, but is controlled by a config file instead.
Please refer to the stunnel(8) manual page for more information.

PR:		42249
Submitted by:	Dan Langille <dan@@langille.org>, lioux
@
text
@d3 1
a3 1
# $FreeBSD$
d16 1
a16 1
    if [ -z "${PACKAGE_BUILDING}" ]; then
@

