[nexuiz-commits] r6474 - trunk/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Apr 11 15:30:34 EDT 2009


Author: div0
Date: 2009-04-11 15:30:33 -0400 (Sat, 11 Apr 2009)
New Revision: 6474

Modified:
   trunk/server/server_havoc_linux.sh
   trunk/server/server_havoc_mac.sh
   trunk/server/server_havoc_windows.bat
   trunk/server/server_linux.sh
   trunk/server/server_mac.sh
   trunk/server/server_windows.bat
Log:
make the sh and bat files able to work from their directory, if server.cfg is set up


Modified: trunk/server/server_havoc_linux.sh
===================================================================
--- trunk/server/server_havoc_linux.sh	2009-04-10 21:29:03 UTC (rev 6473)
+++ trunk/server/server_havoc_linux.sh	2009-04-11 19:30:33 UTC (rev 6474)
@@ -6,4 +6,18 @@
 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 "${@}"

Modified: trunk/server/server_havoc_mac.sh
===================================================================
--- trunk/server/server_havoc_mac.sh	2009-04-10 21:29:03 UTC (rev 6473)
+++ trunk/server/server_havoc_mac.sh	2009-04-11 19:30:33 UTC (rev 6474)
@@ -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 "${@}"

Modified: trunk/server/server_havoc_windows.bat
===================================================================
--- trunk/server/server_havoc_windows.bat	2009-04-10 21:29:03 UTC (rev 6473)
+++ trunk/server/server_havoc_windows.bat	2009-04-11 19:30:33 UTC (rev 6474)
@@ -5,4 +5,24 @@
 
 %~d0
 cd "%~p0"
+
+if exist %executable% goto good
+if not exist ..\%executable% goto bad
+if exist ..\data\server.cfg goto halfgood
+if exist ..\havoc\server.cfg goto halfgood
+goto bad
+
+:bad
+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
+pause
+exit
+
+:halfgood
+cd ..
+
+:good
 .\%executable% -game havoc +serverconfig server.cfg %*

Modified: trunk/server/server_linux.sh
===================================================================
--- trunk/server/server_linux.sh	2009-04-10 21:29:03 UTC (rev 6473)
+++ trunk/server/server_linux.sh	2009-04-11 19:30:33 UTC (rev 6474)
@@ -6,4 +6,18 @@
 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 "${@}"

Modified: trunk/server/server_mac.sh
===================================================================
--- trunk/server/server_mac.sh	2009-04-10 21:29:03 UTC (rev 6473)
+++ trunk/server/server_mac.sh	2009-04-11 19:30:33 UTC (rev 6474)
@@ -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 "${@}"

Modified: trunk/server/server_windows.bat
===================================================================
--- trunk/server/server_windows.bat	2009-04-10 21:29:03 UTC (rev 6473)
+++ trunk/server/server_windows.bat	2009-04-11 19:30:33 UTC (rev 6474)
@@ -5,4 +5,23 @@
 
 %~d0
 cd "%~p0"
+
+if exist %executable% goto good
+if not exist ..\%executable% goto bad
+if exist ..\data\server.cfg goto halfgood
+goto bad
+
+:bad
+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
+pause
+exit
+
+:halfgood
+cd ..
+
+:good
 .\%executable% +serverconfig server.cfg %*



More information about the nexuiz-commits mailing list