#!/bin/sh # # $NetBSD: REQ,v 1.4 2000/09/12 17:23:02 wennmach Exp $ JB_USER=@JB_USER@ JB_USERID=@JB_USERID@ JB_GROUP=@JB_GROUP@ JB_GROUPID=@JB_GROUPID@ PREFIX=@PREFIX@ ADDUSER=@ADDUSER@ ADDGROUP=@ADDGROUP@ PKG=$1 STAGE=$2 if [ "$STAGE" != "INSTALL" ]; then exit 0 fi # Add group first # if grep "^${JB_GROUP}:" /etc/group 2>&1 >/dev/null then echo "Group '$JB_GROUP' already exists, proceeding." else if awk -F: '$3 == $JB_GROUPID {print "notfree"}' /etc/group | grep notfree >/dev/null then echo "Error: group id $JB_GROUPID already in use in /etc/group" echo "Please add group '$JB_GROUP' to /etc/group manually, then restart." exit 1 else echo "Adding group $JB_GROUP (gid $JB_GROUPID) to /etc/group ..." ${ADDGROUP} -g ${JB_GROUPID} ${JB_GROUP} fi fi # use finger to be able to use NIS, ... if finger ${JB_USER} 2>&1 | grep >/dev/null "no such user" then echo "Creating '$JB_USER' user ..." ${ADDUSER} -c "Jitterbug Administrator" \ -b ${PREFIX} \ -u ${JB_USERID} \ -g ${JB_GROUP} \ ${JB_USER} echo Done. else echo "User '$JB_USER' already exists, proceeding." fi exit 0