#!/bin/sh
# DocumentId:	$Id: update-twinspot-skel 982 2001-07-25 10:53:21Z olalu $
# Author:	$Author: olalu $
# Date:		$Date: 2001-07-25 12:53:21 +0200 (ons, 25 jul 2001) $
# Summary:
#	Updates the twinspot base users.

# When adding a user, just do adduser --disabled-password $USER
# With name from /usr/share/twinspot/users/$USER if that file exist.
# If not the name is the same as the login.

# Read the default twinspot config.
. /usr/share/twinspot/defaults.conf

TUSERCFG=/etc/twinspot/adduser.conf.user
TUDIR=/etc/twinspot/adduser

# Read the adduser config file.
. $ADDUSERCFG

for TEST in / /etc ; do
    if mount | grep "on[[:space:]][[:space:]]*$TEST[[:space:]].*type[[:space:]][[:space:]]*nfs[[:space:]]" > /dev/null 2>&1 ; then
	echo "Does not add or remove users when $TEST is nfsmounted."
	exit 0
    fi
done

if [ -d $SKELSRC ] ; then
    rsync -a -I $SKELSRC/ /
fi

if [ -d $PATCHSRC ] ; then
    export PATCHDEST=/
    find $PATCHSRC -type d -name "*.patch" -exec twinspot-patch {} \;
fi
