head	1.4;
access;
symbols
	release_4_2:1.4
	aix_ok:1.3;
locks; strict;
comment	@# @;


1.4
date	94.03.20.03.17.53;	author aoki;	state Exp;
branches;
next	1.3;

1.3
date	93.08.13.03.10.32;	author aoki;	state Exp;
branches;
next	1.2;

1.2
date	93.01.09.02.49.20;	author aoki;	state Exp;
branches;
next	1.1;

1.1
date	92.12.29.02.27.31;	author aoki;	state Exp;
branches;
next	;


desc
@@


1.4
log
@try harder to figure out user name
@
text
@#!/bin/sh
#
# $Header: /usr/local/devel/postgres/src/bin/s2kutils/s2kinit/RCS/s2kinit.sh,v 1.3 1993/08/13 03:10:32 aoki Exp aoki $
#
CMDNAME=`basename $0`

if [ -z "$USER" ]; then
    if [ -z "$LOGNAME" ]; then
	if [ -z "`whoami`" ]; then
	    echo "$CMDNAME: cannot determine user name"
	    exit 1
	fi
    else
	USER=$LOGNAME
	export USER
    fi
fi
#
if [ \! "$PGREALM" ]; then
	echo "$CMDNAME: PGREALM not set"
	exit 1
fi

MYUID=`pg_id`
if [ \! "$KRBVERS" ]; then
	KRBVERS=_fUnKy_KrBvErS_sTuFf_
fi
if  [ "$KRBVERS" -eq 4 ]; then
	if [ "$KRBTKFILE" ]; then
		PG_TKT_FILE=$KRBTKFILE@@$PGREALM
	else
		PG_TKT_FILE=/tmp/tkt$MYUID@@$PGREALM
	fi
	KRBTKFILE=$PG_TKT_FILE; export KRBTKFILE
elif [ "$KRBVERS" -eq 5 ]; then
	if [ "$KRB5CCNAME" ]; then
		PG_TKT_FILE=$KRB5CCNAME@@$PGREALM
	else
		PG_TKT_FILE="FILE:/tmp/krb5cc_$MYUID@@$PGREALM"
	fi
	KRB5CCNAME=$PG_TKT_FILE; export KRB5CCNAME
else
	echo No Kerberos version selected
	exit 1
fi
echo "Ticket file:	$PG_TKT_FILE"

kinit $USER@@$PGREALM
@


1.3
log
@strip off path from command name in messages
@
text
@d3 1
a3 1
# $Header: /home2/aoki/postgres/src/bin/s2kutils/s2kinit/RCS/s2kinit.sh,v 1.2 1993/01/09 02:49:20 aoki Exp aoki $
d6 12
@


1.2
log
@now uses PGREALM
@
text
@a1 1
# $Header: /home2/aoki/postgres/src/bin/s2kutils/s2kinit/RCS/s2kinit.sh,v 1.1 1992/12/29 02:27:31 aoki Exp aoki $
d3 4
d8 1
a8 1
	echo "$0: PGREALM not set"
@


1.1
log
@Initial revision
@
text
@d2 1
a2 1
# $Header$
d4 5
a8 1
MYORG=`s2korg`
d10 20
a29 3
KRBTKFILE=/tmp/tkt$MYUID@@$MYORG; export KRBTKFILE
if [ "$1" ]; then
	USER=$1
d31 3
a33 1
kinit $USER.@@$MYORG
@
