#!/bin/sh
#
# Create the junk for a new user.
#
NEWUSER=$1
GROUP=$2

if [ X${GROUP} = "X" ] ; then
	echo Use: NEWUSER username group
	exit
fi

echo "Creating home directory"
mkdir ${NEWUSER}
chown ${NEWUSER}.${GROUP} ${NEWUSER}

echo "Copying in template files from nobody"
cp -R nobody/* ${NEWUSER}
cp -R nobody/.* ${NEWUSER}
cd ${NEWUSER}
ln -s .bashrc .bash_profile

chown -fR ${NEWUSER}.${GROUP} *
chown -fR ${NEWUSER}.${GROUP} .[a-z]* 
chown -fR ${NEWUSER}.${GROUP} .[A-Z]* 

echo "Creating empty inbox"
cp /dev/null /var/mail/${NEWUSER}
chown ${NEWUSER}.${GROUP} /var/mail/${NEWUSER}
