is_cimsqwbot.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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
  53. echo "4. Now, it's cool to run:"
  54. echo " cd "$BOTPATH" && ./startcimsqwbot.sh"
  55. echo
  56. echo "For an overview of configuration options, please see the wiki at:"
  57. echo "http://redmine.b4r.org/projects/cimsqwbot/wiki"
  58. echo
  59. echo "Have fun."
  60. echo
  61. else
  62. echo
  63. echo "It seems the directories 'cimsqwbot' and 'libqwclient' already exist."
  64. echo "So, we did nothing. If you want a fresh install, delete these directories, but"
  65. echo "be sure to save your cimsqwbot.cfg - if you have a good one."
  66. echo
  67. echo "Did nothing."
  68. echo
  69. fi