#!/bin/sh

# script to initialize the ground state of the 'authuser' and 'proxyuser'
#   databases
# invoked by installation scripts

# @(#)init_users.sh	3.5 99/03/07 Sun Microsystems

read SUNSCREEN_BASE <${SUNSCREEN_ETC:-/etc/opt/SUNWicg/SunScreen}/location
. $SUNSCREEN_BASE/bin/.ssenv.profile

if [ "$SUNSCREEN_DEBUG" != "" ] ; then
	ACMD="$LIB_DIR/authuser -v"
	PCMD="$LIB_DIR/proxyuser -v"
	STR="$LIB_DIR/strs"
else
	ACMD="$BIN_DIR/ssadm lib/authuser"
	PCMD="$BIN_DIR/ssadm lib/proxyuser"
	STR="$BIN_DIR/ssadm lib/strs"
fi

set -e 99	# exit if anything exits

RN=`$STR 1 1970 "SunScreen Administrator"`
DESC=`$STR 1 70 "(created by install)"`
$ACMD add admin password={ "" crypt_password=1hp1R.xm.w63Q } \
	real_name="$RN" \
	description="$DESC"

DESC=`$STR 1 950 "initial SunScreen administrator"`
$PCMD add admin auth_user_name=admin \
	description="$DESC"

DESC=`$STR 1 1971 "SunScreen administrators"`
$PCMD add admin-group group \
	description="$DESC"

$PCMD addmember admin-group admin

DESC=`$STR 1 2150 "unauthenticated user, for anonymous FTP, etc."`
$PCMD add anonymous backend_user_name=anonymous \
	description="$DESC"
$PCMD add ftp backend_user_name=anonymous \
	description="$DESC"

DESC=`$STR 1 1824 "default, external, non-specific RADIUS proxy_user"`
$PCMD add radius radius \
	description="$DESC"

DESC=`$STR 1 1924 "default, external, non-specific SecurID proxy_user"`
$PCMD add securid securid \
	description="$DESC"


# eof
