#!/bin/sh
# $Id: 7.customuser.sh,v 1.14 2004/09/15 16:49:49 drizzt Exp $

set -u

. ./config.sh
. ./.common.sh

echo "Installing customized files..."
cp $LOCALDIR/COPYING $FREESBIEBASEDIR/COPYRIGHT.FreeSBIE || print_error
[ -e $LOCALDIR/files/foobar/irssi_config ] && mkdir $FREESBIEBASEDIR/root/.irssi && cp -v $LOCALDIR/files/foobar/irssi_config $FREESBIEBASEDIR/root/.irssi/config
[ -e $LOCALDIR/files/foobar/mutt.tar.bz2 ] && tar jxvf $LOCALDIR/files/foobar/mutt.tar.bz2 -C $FREESBIEBASEDIR/root/
cp -Rv $LOCALDIR/files/foobar/ $FREESBIEBASEDIR/root/ || print_error
find $FREESBIEBASEDIR/root/ -type d -name CVS -exec rm -rf {} \;
rm -f $FREESBIEBASEDIR/root/irssi_config $FREESBIEBASEDIR/root/mutt.tar.bz2

pw usermod root -V $FREESBIEBASEDIR/etc -s /bin/tcsh || print_error

if [ -f $FREESBIEBASEDIR/usr/X11R6/bin/XFree86 ]; then
	echo "X installed, creating /etc/X11/..."
	mkdir -p $FREESBIEBASEDIR/etc/X11/ || print_error
	rm $FREESBIEBASEDIR/usr/X11R6/bin/X  || print_error
	ln -sf $FREESBIEBASEDIR/usr/X11R6/bin/XFree86 $FREESBIEBASEDIR/usr/X11R6/bin/X || print_error
fi
