$OpenBSD$
--- indra/newview/linux_tools/wrapper.sh.orig	Mon Jan 29 18:17:34 2007
+++ indra/newview/linux_tools/wrapper.sh	Mon Jan 29 18:21:54 2007
@@ -1,16 +1,25 @@
 #!/bin/sh
+
+if [ "$1" = "-grid" -a "$2" ]; then
+	GRID="$2"
+	shift
+	shift
+	GRIDARGS="-settings settings_beta.xml --${GRID} -helperuri http://preview-${GRID}.secondlife.com/helpers/"
+else
+	GRIDARGS="$(cat %PREFIX%/share/secondlife/gridargs.dat)"
+fi
 ## Here are some configuration options for Linux Client Alpha Testers.
 ## These options are for self-assisted troubleshooting during this alpha
 ## testing phase; you should not usually need to touch them.
 
 ## - Avoids using the ESD audio driver.
-#export LL_BAD_ESD=x
+export LL_BAD_ESD=x
 
 ## - Avoids using the OSS audio driver.
 #export LL_BAD_OSS=x
 
 ## - Avoids using the ALSA audio driver.
-#export LL_BAD_ALSA=x
+export LL_BAD_ALSA=x
 
 ## - Avoids the optional OpenGL extensions which have proven most problematic
 ##   on some hardware.  Disabling this option may cause crashes and hangs on
@@ -20,7 +29,7 @@ export LL_GL_BASICEXT=x
 ## - Avoids *all* optional OpenGL extensions.  This is the safest and least-
 ##   exciting option.  Enable this if you experience stability issues, and
 ##   report whether it helps in the Linux Client Alpha Testers forum.
-#export LL_GL_NOEXT=x
+export LL_GL_NOEXT=x
 
 ## - For advanced troubleshooters, this lets you disable specific GL
 ##   extensions, each of which is represented by a letter a-o.  If you can
@@ -36,9 +45,9 @@ export SDL_VIDEO_X11_DGAMOUSE=0
 ## Nothing worth editing below this line.
 ##-------------------------------------------------------------------
 
-RUN_PATH=`dirname "$0" || echo .`
+RUN_PATH=%PREFIX%/share/secondlife
 cd "${RUN_PATH}"
-LD_LIBRARY_PATH="`pwd`"/lib:"${LD_LIBRARY_PATH}" bin/do-not-directly-run-secondlife-bin `cat gridargs.dat` $@ | cat
+./bin/do-not-directly-run-secondlife-bin $GRIDARGS $@ | cat
 
 echo
 echo '*********************************************************'
