|
@@ -0,0 +1,124 @@
|
|
|
+#!/bin/bash
|
|
|
+
|
|
|
+if [ ! -d "libqwclient" ]; then
|
|
|
+ git clone https://github.com/buhnemann/libqwclient.git
|
|
|
+ INSTALL=1
|
|
|
+fi
|
|
|
+
|
|
|
+if [ ! -d "cimsqwbot" ]; then
|
|
|
+ git clone git://b4r.org/cimsqwbot
|
|
|
+ INSTALL=1
|
|
|
+fi
|
|
|
+
|
|
|
+cd cimsqwbot
|
|
|
+BOTPATH=$(pwd)
|
|
|
+
|
|
|
+cd ../libqwclient/
|
|
|
+LIBPATH=$(pwd)
|
|
|
+
|
|
|
+CONFIGNAME="$BOTPATH/cimsqwbot.cfg"
|
|
|
+STARTSCRIPTNAME="$BOTPATH/startcimsqwbot.sh"
|
|
|
+
|
|
|
+if [ "$INSTALL" == "1" ]; then
|
|
|
+
|
|
|
+ # is the configuration file missing? then...
|
|
|
+ if [ ! -f "$CONFIGNAME" ]; then
|
|
|
+
|
|
|
+ cd "$LIBPATH"
|
|
|
+ git pull
|
|
|
+ qmake
|
|
|
+ make
|
|
|
+
|
|
|
+ cd "$BOTPATH"
|
|
|
+ git pull
|
|
|
+ qmake
|
|
|
+ make
|
|
|
+
|
|
|
+ LD_LIBRARY_PATH=$LIBPATH ./cimsqwbot &
|
|
|
+ PID=$!
|
|
|
+ echo PID $PID
|
|
|
+
|
|
|
+ sleep 1
|
|
|
+ kill $PID
|
|
|
+
|
|
|
+ # cfg file should have been created by the start of cimsqwbot.
|
|
|
+
|
|
|
+ fi
|
|
|
+
|
|
|
+ # now, lets create a starting script in cimsqwbot
|
|
|
+ if [ ! -f "$STARTSCRIPTNAME" ]; then
|
|
|
+
|
|
|
+ (
|
|
|
+ cat <<- EOFINSTALLSCRIPT
|
|
|
+#!/bin/sh
|
|
|
+
|
|
|
+ BOTPATH="\$pwd"
|
|
|
+ LIBPATH="$BOTPATH/../libqwclient/"
|
|
|
+ if [ "`which realpath`" != "" ]; then
|
|
|
+ LIBPATH="$(realpath $LIBPATH)"
|
|
|
+ fi
|
|
|
+ echo BOTPATH: "$BOTPATH"
|
|
|
+ echo LIBPATH: "$LIBPATH"
|
|
|
+
|
|
|
+ while [ 1 ]; do
|
|
|
+ cd "$LIBPATH"
|
|
|
+ git pull
|
|
|
+ qmake
|
|
|
+ make
|
|
|
+
|
|
|
+ cd "$BOTPATH"
|
|
|
+ git pull
|
|
|
+ qmake
|
|
|
+ make
|
|
|
+
|
|
|
+ echo started at \$(date) >> runlog.log
|
|
|
+ LD_LIBRARY_PATH=$LIBPATH stdbuf -oL ./cimsqwbot | tee -a runlog.log
|
|
|
+ echo crashed at \$(date) - lol, we never crash. >> runlog.log
|
|
|
+
|
|
|
+ sleep 3
|
|
|
+ done
|
|
|
+ EOFINSTALLSCRIPT
|
|
|
+ ) > "$STARTSCRIPTNAME"
|
|
|
+
|
|
|
+ if [ -f "$STARTSCRIPTNAME" ]; then
|
|
|
+ chmod u+x "$STARTSCRIPTNAME"
|
|
|
+ fi
|
|
|
+
|
|
|
+ fi
|
|
|
+
|
|
|
+ cd "$BOTPATH"
|
|
|
+ echo
|
|
|
+ echo "The installation is now ready to run. BUT..."
|
|
|
+ echo
|
|
|
+ echo "1. Because you need the original maps, place pak0.pak and pak1.pak of original quake there:"
|
|
|
+ echo " $BOTPATH/id1"
|
|
|
+ echo
|
|
|
+ echo "2. Please know, that you need maps. The bot will start downloading them often, which takes time."
|
|
|
+ echo " It is advised, you get some maps already and put them in the appropriate gamedir under"
|
|
|
+ echo " $BOTPATH"
|
|
|
+ echo " gamedir qw example: $BOTPATH/qw/maps"
|
|
|
+ echo " gamedir fortress example: $BOTPATH/fortress/maps"
|
|
|
+ echo
|
|
|
+ echo "3. Please edit the $CONFIGNAME"
|
|
|
+ echo
|
|
|
+ echo "4. Now, it's cool to run:"
|
|
|
+ echo " cd "$BOTPATH" && ./startcimsqwbot.sh"
|
|
|
+ echo
|
|
|
+ echo "For an overview of configuration options, please see the wiki at:"
|
|
|
+ echo "http://redmine.b4r.org/projects/cimsqwbot/wiki"
|
|
|
+ echo
|
|
|
+ echo "Have fun."
|
|
|
+ echo
|
|
|
+
|
|
|
+else
|
|
|
+
|
|
|
+ echo
|
|
|
+ echo "It seems the directories 'cimsqwbot' and 'libqwclient' already exist."
|
|
|
+ echo "So, we did nothing. If you want a fresh install, delete these directories, but"
|
|
|
+ echo "be sure to save your cimsqwbot.cfg - if you have a good one."
|
|
|
+ echo
|
|
|
+ echo "Did nothing."
|
|
|
+ echo
|
|
|
+
|
|
|
+fi
|
|
|
+
|