make the sh and bat files able to work from their directory, if server.cfg is set up
[divverent/nexuiz.git] / server / server_havoc_mac.sh
1 #!/bin/sh
2
3 executable="nexuiz-osx-dedicated"
4
5 cd "`dirname "${0}"`"
6
7 if ! [ -x "$executable" ]; then
8         if [ -x "../$executable" ] && { [ -f ~/.nexuiz/data/server.cfg ] || [ -f ../data/server.cfg ] || [ -f ~/.nexuiz/havoc/server.cfg ] || [ -f ../havoc/server.cfg ]; }; then
9                 cd ..
10         else
11                 echo "This script is not properly set up yet."
12                 echo "Please refer to the instructions in readme.txt."
13                 echo "In short:"
14                 echo "- copy server.cfg to the data directory and adjust its settings"
15                 echo "- move this file to the main directory of your Nexuiz installation"
16                 exit 1
17         fi
18 fi
19
20 exec ./${executable} -game havoc +serverconfig server.cfg "${@}"