is_cimsqwbot.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/bin/bash
  2. if [ ! -d "libqwclient" ]; then
  3. git clone https://github.com/buhnemann/libqwclient.git
  4. INSTALL=1
  5. fi
  6. if [ ! -d "cimsqwbot" ]; then
  7. git clone git://b4r.org/cimsqwbot
  8. INSTALL=1
  9. fi
  10. cd cimsqwbot
  11. BOTPATH=$(pwd)
  12. cd ../libqwclient/
  13. LIBPATH=$(pwd)
  14. CONFIGNAME="$BOTPATH/cimsqwbot.cfg"
  15. STARTSCRIPTNAME="$BOTPATH/startcimsqwbot.sh"
  16. if [ "$INSTALL" == "1" ]; then
  17. # is the configuration file missing? then...
  18. if [ ! -f "$CONFIGNAME" ]; then
  19. cd "$LIBPATH"
  20. git pull
  21. qmake
  22. make
  23. cd "$BOTPATH"
  24. git pull
  25. qmake
  26. make
  27. LD_LIBRARY_PATH=$LIBPATH ./cimsqwbot &
  28. PID=$!
  29. echo PID $PID
  30. sleep 1
  31. kill $PID
  32. # cfg file should have been created by the start of cimsqwbot.
  33. fi
  34. # now, lets check the starting script to be executable in cimsqwbot
  35. if [ -f "$STARTSCRIPTNAME" ]; then
  36. chmod u+x "$STARTSCRIPTNAME"
  37. fi
  38. cd "$BOTPATH"
  39. echo
  40. echo "The installation is now ready to run. BUT..."
  41. echo
  42. echo "1. Because you need the original maps, place pak0.pak and pak1.pak of original quake there:"
  43. echo " $BOTPATH/id1"
  44. echo
  45. echo "2. Please know, that you need maps. The bot will start downloading them often, which takes time."
  46. echo " It is advised, you get some maps already and put them in the appropriate gamedir under"
  47. echo " $BOTPATH"
  48. echo " gamedir qw example: $BOTPATH/qw/maps"
  49. echo " gamedir fortress example: $BOTPATH/fortress/maps"
  50. echo
  51. echo "3. Please edit the $CONFIGNAME"
  52. echo " For an overview of configuration options, please see the wiki at:"
  53. echo " http://redmine.b4r.org/projects/cimsqwbot/wiki"
  54. echo
  55. echo "4. Now, it's cool to run:"
  56. echo " cd "$BOTPATH" && ./startcimsqwbot.sh"
  57. echo
  58. echo "Have fun."
  59. echo
  60. else
  61. echo
  62. echo "It seems the directories 'cimsqwbot' and 'libqwclient' already exist."
  63. echo "So, we did nothing. If you want a fresh install, delete these directories, but"
  64. echo "be sure to save your cimsqwbot.cfg - if you have a good one."
  65. echo
  66. echo "Did nothing."
  67. echo
  68. fi