[Server] Scripts
vlnc
Join Date: 2010-09-07 Member: 73921Members, Squad Five Blue
<div class="IPBDescription">Some scripts to launch server</div>Hi, may this can help people to launch your server on ns2.
<a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=112026" target="_blank">NS2-GmOvrmind</a> (-game C:\ns2server\NS2GmOvrmind) ty player
<a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=113414" target="_blank">Automatic Updates</a> (ns2update.exe) ty devicenull
Here are my scripts :
[Windows]
restart.bat :
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->@echo OFF
echo "Kill server.exe and ns2update.exe"
taskkill /F /IM server.exe
taskkill /F /IM ns2update.exe
echo "Lancement Serveur"
cd C:\ns2server
ns2update.exe -file C:\ns2server\server.xml -ip 88.190.18.171 --restartwhenempty -game C:\ns2server\NS2GmOvrmind
REM start /AFFINITY 3 server.exe -file C:\ns2server\server.xml -game C:\ns2server\NS2GmOvrmind<!--c2--></div><!--ec2-->
[CentOS (linux)]
ns2restart :
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->#/bin/bash
echo -e "\n##########################################"
echo "### SERVER RESTART NATURAL SELECTION 2 ###"
echo "##########################################"
echo -e "\nVerification process server.exe"
servergrep=`pgrep -l server.exe`
if [ "$servergrep" ]; then
echo -e "\nLe serveur va etre arreter"
pkill server.exe
echo -e "\nRedemarrage du serveur ns2\n"
screen -dmS ns2restart wine server.exe -file server.xml -game NS2GmOvrmind
else
echo "\Le serveur n'est pas demarre"
sleep 1
clear
exit
fi<!--c2--></div><!--ec2-->
About the screen software for people who don't know what it is, screen is a full-screen window manager. Like i'm launching the script in terminal window, it's good to detach and reattach your window. (<a href="http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/" target="_blank">more informations here</a>)
<a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=112026" target="_blank">NS2-GmOvrmind</a> (-game C:\ns2server\NS2GmOvrmind) ty player
<a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=113414" target="_blank">Automatic Updates</a> (ns2update.exe) ty devicenull
Here are my scripts :
[Windows]
restart.bat :
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->@echo OFF
echo "Kill server.exe and ns2update.exe"
taskkill /F /IM server.exe
taskkill /F /IM ns2update.exe
echo "Lancement Serveur"
cd C:\ns2server
ns2update.exe -file C:\ns2server\server.xml -ip 88.190.18.171 --restartwhenempty -game C:\ns2server\NS2GmOvrmind
REM start /AFFINITY 3 server.exe -file C:\ns2server\server.xml -game C:\ns2server\NS2GmOvrmind<!--c2--></div><!--ec2-->
[CentOS (linux)]
ns2restart :
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->#/bin/bash
echo -e "\n##########################################"
echo "### SERVER RESTART NATURAL SELECTION 2 ###"
echo "##########################################"
echo -e "\nVerification process server.exe"
servergrep=`pgrep -l server.exe`
if [ "$servergrep" ]; then
echo -e "\nLe serveur va etre arreter"
pkill server.exe
echo -e "\nRedemarrage du serveur ns2\n"
screen -dmS ns2restart wine server.exe -file server.xml -game NS2GmOvrmind
else
echo "\Le serveur n'est pas demarre"
sleep 1
clear
exit
fi<!--c2--></div><!--ec2-->
About the screen software for people who don't know what it is, screen is a full-screen window manager. Like i'm launching the script in terminal window, it's good to detach and reattach your window. (<a href="http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/" target="_blank">more informations here</a>)
Comments
Have you got a working command launch with ns2update + server.xml +overmind ?
edit : ok I added -file server.xml and it works great now with your mod ty devicenull