#!/bin/sh
#
# This startup script will set the correct library path
# and then startup the teamspeak binary.
#

TSHOME=/usr/local/lib/teamspeak_client
if [ -z "$LD_LIBRARY_PATH" ]; then
  export LD_LIBRARY_PATH=$TSHOME
else
  export LD_LIBRARY_PATH=$TSHOME:$LD_LIBRARY_PATH
fi

if [ -r $TSHOME/setduplexfake.so ]; then
  if [ -z "$LD_PRELOAD" ]; then
    export LD_PRELOAD=$TSHOME/setduplexfake.so
  else
    export LD_PRELOAD=$TSHOME/setduplexfake.so:$LD_PRELOAD
  fi
fi

exec $TSHOME/TeamSpeak.bin "$@"
