make the sh and bat files able to work from their directory, if server.cfg is set up
authordiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Sat, 11 Apr 2009 19:30:33 +0000 (19:30 +0000)
committerdiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Sat, 11 Apr 2009 19:30:33 +0000 (19:30 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@6474 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

server/server_havoc_linux.sh
server/server_havoc_mac.sh
server/server_havoc_windows.bat
server/server_linux.sh
server/server_mac.sh
server/server_windows.bat

index 21fef57..dbd7ed1 100755 (executable)
@@ -6,4 +6,18 @@ case "$(uname -m)" in
 esac
 
 cd "`dirname "${0}"`"
+
+if ! [ -x "$executable" ]; then
+       if [ -x "../$executable" ] && { [ -f ~/.nexuiz/data/server.cfg ] || [ -f ../data/server.cfg ] || [ -f ~/.nexuiz/havoc/server.cfg ] || [ -f ../havoc/server.cfg ]; }; then
+               cd ..
+       else
+               echo "This script is not properly set up yet."
+               echo "Please refer to the instructions in readme.txt."
+               echo "In short:"
+               echo "- copy server.cfg to the data directory and adjust its settings"
+               echo "- move this file to the main directory of your Nexuiz installation"
+               exit 1
+       fi
+fi
+
 exec ./${executable} -game havoc +serverconfig server.cfg "${@}"
index 89c07a0..c3b12f1 100755 (executable)
@@ -3,4 +3,18 @@
 executable="nexuiz-osx-dedicated"
 
 cd "`dirname "${0}"`"
+
+if ! [ -x "$executable" ]; then
+       if [ -x "../$executable" ] && { [ -f ~/.nexuiz/data/server.cfg ] || [ -f ../data/server.cfg ] || [ -f ~/.nexuiz/havoc/server.cfg ] || [ -f ../havoc/server.cfg ]; }; then
+               cd ..
+       else
+               echo "This script is not properly set up yet."
+               echo "Please refer to the instructions in readme.txt."
+               echo "In short:"
+               echo "- copy server.cfg to the data directory and adjust its settings"
+               echo "- move this file to the main directory of your Nexuiz installation"
+               exit 1
+       fi
+fi
+
 exec ./${executable} -game havoc +serverconfig server.cfg "${@}"
index e5368c5..7441362 100644 (file)
@@ -5,4 +5,24 @@ set executable=nexuiz -dedicated
 \r
 %~d0\r
 cd "%~p0"\r
+\r
+if exist %executable% goto good\r
+if not exist ..\%executable% goto bad\r
+if exist ..\data\server.cfg goto halfgood\r
+if exist ..\havoc\server.cfg goto halfgood\r
+goto bad\r
+\r
+:bad\r
+echo This script is not properly set up yet.\r
+echo Please refer to the instructions in readme.txt.\r
+echo In short:\r
+echo - copy server.cfg to the data directory and adjust its settings\r
+echo - move this file to the main directory of your Nexuiz installation\r
+pause\r
+exit\r
+\r
+:halfgood\r
+cd ..\r
+\r
+:good\r
 .\%executable% -game havoc +serverconfig server.cfg %*\r
index 7d200cb..cddfe9c 100755 (executable)
@@ -6,4 +6,18 @@ case "$(uname -m)" in
 esac
 
 cd "`dirname "${0}"`"
+
+if ! [ -x "$executable" ]; then
+       if [ -x "../$executable" ] && { [ -f ~/.nexuiz/data/server.cfg ] || [ -f ../data/server.cfg ]; }; then
+               cd ..
+       else
+               echo "This script is not properly set up yet."
+               echo "Please refer to the instructions in readme.txt."
+               echo "In short:"
+               echo "- copy server.cfg to the data directory and adjust its settings"
+               echo "- move this file to the main directory of your Nexuiz installation"
+               exit 1
+       fi
+fi
+
 exec ./${executable} +serverconfig server.cfg "${@}"
index 9422841..3c45697 100755 (executable)
@@ -3,4 +3,18 @@
 executable="nexuiz-osx-dedicated"
 
 cd "`dirname "${0}"`"
+
+if ! [ -x "$executable" ]; then
+       if [ -x "../$executable" ] && { [ -f ~/.nexuiz/data/server.cfg ] || [ -f ../data/server.cfg ]; }; then
+               cd ..
+       else
+               echo "This script is not properly set up yet."
+               echo "Please refer to the instructions in readme.txt."
+               echo "In short:"
+               echo "- copy server.cfg to the data directory and adjust its settings"
+               echo "- move this file to the main directory of your Nexuiz installation"
+               exit 1
+       fi
+fi
+
 exec ./${executable} +serverconfig server.cfg "${@}"
index bba5969..164182f 100644 (file)
@@ -5,4 +5,23 @@ set executable=nexuiz -dedicated
 \r
 %~d0\r
 cd "%~p0"\r
+\r
+if exist %executable% goto good\r
+if not exist ..\%executable% goto bad\r
+if exist ..\data\server.cfg goto halfgood\r
+goto bad\r
+\r
+:bad\r
+echo This script is not properly set up yet.\r
+echo Please refer to the instructions in readme.txt.\r
+echo In short:\r
+echo - copy server.cfg to the data directory and adjust its settings\r
+echo - move this file to the main directory of your Nexuiz installation\r
+pause\r
+exit\r
+\r
+:halfgood\r
+cd ..\r
+\r
+:good\r
 .\%executable% +serverconfig server.cfg %*\r