head	1.2;
access;
symbols
	RELEASE_8_1_0:1.1
	RELEASE_7_3_0:1.1
	RELEASE_8_0_0:1.1
	RELEASE_7_2_0:1.1;
locks; strict;
comment	@# @;


1.2
date	2010.09.22.05.21.28;	author pgollucci;	state dead;
branches;
next	1.1;

1.1
date	2009.03.10.07.45.26;	author miwi;	state Exp;
branches;
next	;


desc
@@


1.2
log
@- Convert to USERS/GROUPS

PR:             ports/150230
Submitted by:   Eitan Adler <lists@@eitanadler.com>
Approved by:    dkg@@fifthhorseman.net (maintainer)
@
text
@#!/bin/sh

# an installation script for monkeysphere (borrowing liberally from
# postgresql and mysql pkg-install scripts, and from monkeysphere's
# debian/monkeysphere.postinst)

# Author: Daniel Kahn Gillmor <dkg@@fifthhorseman.net>
# Copyright 2008,2009

# FIXME: is /var/monkeysphere the right place for this stuff on
# FreeBSD?

# PostgreSQL puts its data in /usr/local/pgsql/data

# MySQL puts its data in /var/db/mysql

VARLIB="/var/monkeysphere"
ETCDIR="/usr/local/etc/monkeysphere"

case $2 in
POST-INSTALL)
        USER=monkeysphere
        GROUP=${USER}
        UID=641
        GID=${UID}
        SHELL=/usr/local/bin/bash

        if pw group show "${GROUP}" >/dev/null 2>&1; then
                echo "You already have a group \"${GROUP}\", so I will use it."
        else
                if pw groupadd ${GROUP} -g ${GID}; then
                        echo "Added group \"${GROUP}\"."
                else
                        echo "Adding group \"${GROUP}\" failed..."
                        exit 1
                fi
        fi

	if pw user show "${USER}" >/dev/null 2>&1; then
            oldshell=`pw user show "${USER}" 2>/dev/null | cut -f10 -d:`
	    if [ x"$oldshell" != x"$SHELL" ]; then
		echo "You already have a \"${USER}\" user, but its shell is '$oldshell'."
		echo "This package requires that \"${USER}\"'s shell be '$SHELL'."
		echo "You should fix this by hand and then re-install the package."
		echo "   hint: pw usermod '$USER' -s '$SHELL'"
		exit 1
	    fi
            echo "You already have a user \"${USER}\" with the proper shell, so I will use it."
        else
                if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
                        -d "$VARLIB" -s /usr/local/bin/bash -c "monkeysphere authentication user,,,"
                then
                        echo "Added user \"${USER}\"."
                else
                        echo "Adding user \"${USER}\" failed..."
                        exit 1
                fi
        fi

	## set up the monkeysphere authentication cache directory:

	monkeysphere-authentication setup
        ;;
esac
@


1.1
log
@SSH key-based authentication is tried-and-true, but it lacks a true
Public Key Infrastructure for key certification, revocation and
expiration.  Monkeysphere is a framework that uses the OpenPGP web of
trust for these PKI functions.  It can be used in both directions: for
users to get validated host keys, and for hosts to authenticate users.

WWW: http://web.monkeysphere.info/

PR:		ports/128406
Submitted by:	Daniel Kahn Gillmor <dkg at fifthhorseman.net>
@
text
@@

