#!/bin/sh

# First-stage q3ded loader. This gets the userid and new root directory
# set up for security purposes. 
# Some stuff for easy maintenance. To switch the game, set CONFIGFILE.

UCHROOT=/usr/local/sbin/uchroot
NEWROOT=/usr/local/q3      # where to chroot to
NEWUSER=q3	      # user to switch to - we're root right now
LOADER2=/quake3/startq3 # Second stage loader. Path relative to $NEWROOT. 

cd $NEWROOT
# Become the appropriate user and chroot, all in one fell swoop

su $NEWUSER -c "$UCHROOT $NEWROOT $LOADER2"
