d45ae168d5ca5e70b465170000ac7f1837395d54
[xonotic/xonotic.git] / server / server_linux.sh
1 #!/bin/sh
2
3 case "$(uname -m)" in
4   x86_64)       executable="xonotic-linux64-dedicated" ;;
5   *)            executable="xonotic-linux32-dedicated" ;;
6 esac
7
8 cd "`dirname "${0}"`"
9
10 if ! [ -x "$executable" ]; then
11         if [ -x "../$executable" ] && { [ -f ~/.xonotic/data/server.cfg ] || [ -f ../data/server.cfg ]; }; then
12                 cd ..
13         else
14                 echo "This script is not properly set up yet."
15                 echo "Please refer to the instructions in readme.txt."
16                 echo "In short:"
17                 echo "- copy server.cfg to the data directory and adjust its settings"
18                 echo "- move this file to the main directory of your Xonotic installation"
19                 exit 1
20         fi
21 fi
22
23 exec ./${executable} +serverconfig server.cfg "${@}"