#!/bin/bash
cd /path/to/quake
export LD_PRELOAD=libpthread.so.0	
IP=`echo $1 | cut -d "/" -f 3`
TYPE=`echo $1 | cut -d "/" -f 4`
if [ "$TYPE" = "observe"];
	then
		./fuhquake-gl.glx -nosound -width 800 -height 600 +cfg_load jogi_spec +set spectator 1 +set cl_confirmquit 0 +connect $IP
	else
		./fuhquake-gl.glx -nosound -width 800 -height 600 +cfg_load jogi_play +set spectator 0 +set cl_confirmquit 0 +connect $IP
fi
