Wolfos

Half Life 2 shell script

Apr 1st, 2012
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # figure out the absolute path to the script being run a bit
  4. # non-obvious, the ${0%/*} pulls the path out of $0, cd's into the
  5. # specified directory, then uses $PWD to figure out where that
  6. # directory lives - and all this in a subshell, so we don't affect
  7. # $PWD
  8.  
  9. GAMEROOT=$(cd "${0%/*}" && echo $PWD)
  10.  
  11. #determine platform
  12. UNAME=`uname`
  13. if [ "$UNAME" == "Darwin" ]; then
  14. # prepend our lib path to LD_LIBRARY_PATH
  15. export DYLD_LIBRARY_PATH="${GAMEROOT}"/bin:$DYLD_LIBRARY_PATH
  16. elif [ "$UNAME" == "Linux" ]; then
  17. # prepend our lib path to LD_LIBRARY_PATH
  18. export LD_LIBRARY_PATH="${GAMEROOT}"/bin:$LD_LIBRARY_PATH
  19. fi
  20.  
  21. if [ -z $GAMEEXE ]; then
  22. GAMEEXE=hl2_osx
  23. fi
  24.  
  25. ulimit -n 2048
  26.  
  27. # and launch the game
  28. cd "$GAMEROOT"
  29.  
  30. STATUS=42
  31. while [ $STATUS -eq 42 ]; do
  32. ${DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"
  33. STATUS=$?
  34. done
  35. exit $STATUS
Advertisement
Add Comment
Please, Sign In to add comment