#! /bin/sh
# 
# Common configuration code for server and master server
# tested on Gentoo Linux 2004.4
# Author: Manuel Moos <manuel@moosnet.de>
#

test -r /etc/rc.config && . /etc/rc.config

BINDIR=$PROGDIR/bin
RCDDIR=$PROGDIR/rc.d

#find configuration directory
if test yes = yes ; then
    CONFIG=/etc/armagetronad
else
    CONFIG=$PROGDIR/config
fi

# load configuration file
CONFIGFILE=$CONFIG/rc.config
test -r $CONFIGFILE && . $CONFIGFILE

# test if user exists
test "$user" = "$USER" || su "$user" -c "echo" > /dev/null 2>&1 || { echo "Armagetron Advanced configuration problem: User $user does not exist or cannot be su'd to."; exit 1; }