#!/bin/bash

MINETC=/usr/local/minerva/etc/users
VARLOG=/var/log/minerva

date +"%F %H:%M CMD $0 $*" >>$VARLOG/bearskin/`basename $0`

USER=$1
FULLNAME=$2

if [ "$USER" == "" ]; then
   echo "Usage: $0 <username> [fullname]"
   exit 1;
fi

if [ "$FULLNAME" == "" ]; then
   FULLNAME=$USER
fi

mkdir -p $MINETC/$USER
echo $FULLNAME > $MINETC/$USER/name

mkdir -p $MINETC/$USER/tvsearch
echo > $MINETC/$USER/tvsearch/list

chgrp -R minerva $MINETC/$USER
chmod -R ug+rw $MINETC/$USER

