Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

rizzeh

By: a guest on Apr 18th, 2009  |  syntax: None  |  size: 4.41 KB  |  views: 355  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2. #
  3. # Unreal Tournament startup script
  4. #
  5.  
  6. # Modifications by Eskild Hustvedt
  7.  
  8. # The user preferences directory
  9. UT_PREFS="${HOME}/.loki/ut"
  10.  
  11. # Function to find the real directory a program resides in.
  12. # Feb. 17, 2000 - Sam Lantinga, Loki Entertainment Software
  13. FindPath()
  14. {
  15.     fullpath="`echo $1 | grep /`"
  16.     if [ "$fullpath" = "" ]; then
  17.         oIFS="$IFS"
  18.         IFS=:
  19.         for path in $PATH
  20.         do if [ -x "$path/$1" ]; then
  21.                if [ "$path" = "" ]; then
  22.                    path="."
  23.                fi
  24.                fullpath="$path/$1"
  25.                break
  26.            fi
  27.         done
  28.         IFS="$oIFS"
  29.     fi
  30.     if [ "$fullpath" = "" ]; then
  31.         fullpath="$1"
  32.     fi
  33.     # Is the awk/ls magic portable?
  34.     if [ -L "$fullpath" ]; then
  35.         fullpath="`ls -l "$fullpath" | awk '{print $11}'`"
  36.     fi
  37.     dirname $fullpath
  38. }
  39.  
  40. # Set the home if not already set.
  41. if [ "${UT_DATA_PATH}" = "" ]; then
  42.     UT_DATA_PATH="`FindPath $0`/System"
  43. fi
  44.  
  45. LD_LIBRARY_PATH=.:${UT_DATA_PATH}:${LD_LIBRARY_PATH}
  46.  
  47. export LD_LIBRARY_PATH
  48. export UT_DATA_PATH
  49.  
  50. create_prefpath()
  51. {
  52.     path="${UT_PREFS}/$1"
  53.     if [ ! -d "$path" ]; then
  54.         echo "Creating directory $path"
  55.         mkdir "$path"
  56.     fi
  57. }
  58.  
  59. copy_if_needed()
  60. {
  61.     dist="${UT_DATA_PATH}/$1"
  62.     file="${UT_PREFS}/$1"
  63.     if [ ! -f "$file" ]; then
  64.         echo "Installing default $file"
  65.         cp "$dist" "$file"
  66.     fi
  67. }
  68.  
  69. # Hey, it's fun time!
  70. if [ ! -d ${HOME}/.loki ]
  71. then
  72.     mkdir ${HOME}/.loki
  73. fi
  74.  
  75. if [ ! -d ${UT_PREFS} ]
  76. then
  77.     echo "Creating preferences directory..."
  78.     create_prefpath
  79. fi
  80. create_prefpath System
  81.  
  82. # Flood the CPU for four seconds so that it is running at the currect speed
  83. RandomFork () {
  84.         while [ "$SECONDS" -le "4" ]; do
  85.                 let MYRND="$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM*$RANDOM$RANDOM+$RANDOM*$RANDOM/$RANDOM*$RANDOM"
  86.         done
  87. }
  88. RandomFork &
  89.  
  90. # Let's boogie!
  91. if [ -x "${UT_DATA_PATH}/ut-bin" ]
  92. then
  93.         echo -n "Sleeping for 1 second... ";sleep 1s;echo "done - launching UT"
  94.         cd "${UT_DATA_PATH}/"
  95.         exec "./ut-bin" -log $*
  96. fi
  97. echo "Couldn't run Unreal Tournament (ut-bin). Is UT_DATA_PATH set?"
  98. exit 1
clone this paste RAW Paste Data