head	1.3;
access;
symbols
	RELEASE_8_3_0:1.2
	RELEASE_9_0_0:1.2
	RELEASE_7_4_0:1.2
	RELEASE_8_2_0:1.2
	RELEASE_6_EOL:1.2
	RELEASE_8_1_0:1.2
	RELEASE_7_3_0:1.2
	RELEASE_8_0_0:1.2
	RELEASE_7_2_0:1.2
	RELEASE_7_1_0:1.2
	RELEASE_6_4_0:1.2
	RELEASE_5_EOL:1.2
	RELEASE_7_0_0:1.2
	RELEASE_6_3_0:1.2
	PRE_XORG_7:1.2
	RELEASE_4_EOL:1.2
	RELEASE_6_2_0:1.2
	RELEASE_6_1_0:1.2
	RELEASE_5_5_0:1.2
	RELEASE_6_0_0:1.2
	RELEASE_5_4_0:1.2
	RELEASE_4_11_0:1.1
	RELEASE_5_3_0:1.1
	RELEASE_4_10_0:1.1;
locks; strict;
comment	@# @;


1.3
date	2012.11.17.06.01.09;	author svnexp;	state Exp;
branches;
next	1.2;

1.2
date	2005.02.05.18.46.16;	author pav;	state Exp;
branches;
next	1.1;

1.1
date	2004.04.20.20.36.39;	author sergei;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Switch exporter over
@
text
@#!/bin/sh
#
# $FreeBSD: head/security/osiris/pkg-install 300897 2012-07-14 14:29:18Z beat $
#

ask() {
    local question default answer

    question=$1
    default=$2
    if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
	read -p "${question} [${default}]? " answer
    fi
    echo ${answer:-${default}}
}

yesno() {
    local question default answer

    question=$1
    default=$2
    while :; do
	answer=$(ask "${question}" "${default}")
	case "${answer}" in
	[Yy]*)	return 0;;
	[Nn]*)	return 1;;
	esac
	echo "Please answer yes or no."
    done
}

make_account() {
    local u g gcos

    u=$1
    g=$2
    gcos=$3

    if pw group show "${g}" >/dev/null 2>&1; then
	echo "You already have a group \"${g}\", so I will use it."
    else
	echo "You need a group \"${g}\"."
	if which -s pw && yesno "Would you like me to create it" y
	then
	    pw groupadd ${g} || exit
	    echo "Done."
	else
	    echo "Please create it, and try again."
	    exit 1
	fi
    fi
    
    if pw user show "${u}" >/dev/null 2>&1; then
	echo "You already have a user \"${u}\", so I will use it."
    else
	echo "You need a user \"${u}\"."
	if which -s pw && yesno "Would you like me to create it" y
	then
	    pw useradd ${u} -g ${g} -h - -d /nonexistent -s /sbin/nologin -c "${gcos}" || exit
	    echo "Done."
	else
	    echo "Please create it, and try again."
	    exit 1
	fi
    fi
}

case $2 in

PRE-INSTALL)
    make_account osiris osiris "Osiris"
    ;;
esac
@


1.2
log
@- Update to 4.1.1

PR:		ports/77110
Submitted by:	David Thiel <lx@@redundancy.redundancy.org> (maintainer)
@
text
@d3 1
a3 1
# $FreeBSD: ports/security/osiris/pkg-install,v 1.1 2004/04/20 20:36:39 sergei Exp $
@


1.1
log
@- Update to 2.4.4, a more recent stable version
- Pass maintainership to the submitter

PR:		ports/63077
Submitted by:	David Thiel <lx@@redundancy.redundancy.org>
Approved by:	Nicolas Jombart (current maintainer)
@
text
@d3 1
a3 1
# $FreeBSD$
d59 1
a59 1
	    pw useradd ${u} -g ${g} -h - -d /usr/local/etc/osiris -s /sbin/nologin -c "${gcos}" || exit
@

