#!/bin/sh
# DocumentId:	$Id: update-dpsyco-users-patch,v 1.5 2001/12/07 15:38:30 ola Exp $
# Author:	$Author: ola $
# Date:		$Date: 2001/12/07 15:38:30 $
# Summary:
#	Updates the dpsyco base users skeleton, and patch if needed.

# Read the default dpsyco config.
. /etc/dpsyco/defaults.conf

TESTNFS="/ $DHOME /etc"
. /usr/share/dpsyco/checknfs.test

# Users that exist in password file.
EUSERS=$(grep "^[^:]*:[^:]*:$UID_MATCH:" $PWDF | sed -e "s|:.*||g;")

for U in $EUSERS ; do
    if [ -d "$DHOME/$U" ] ; then
	if [ -d "$USERPATCHSRC" ] ; then
	    dpsyco-patch $USERPATCHSRC $DHOME/$U "" alluser.
	fi
	if [ -d "$USERSKELSRC" ] ; then
	    dpsyco-patch $USERSKELSRC $DHOME/$U "-path '$USERSKELSRC/*/$U/*'" user.
	fi
    fi
done
