Der oberste Chaf
Registriert seit: 13.11.2009
Ort: Wiesbaden
Alter: 48
Beiträge: 8.721
Beigetretene Cups: 10 Cup Siege: 2 Downloads: 1399
Uploads: 2697
|
Auf der nächsten Seite, Linux-Server Startscript
Seite 1: Einführung, Starten, Einstellungen, Vote, Firewall, Administration
Seite 2: LinuxStartscript
Seite 3: CustomMaps und CustomMutators, Map/GameMode-Voting mit BIA-Vote, Redirect (FastDownload)
Copyright
This tutorial is copyright of its author.
Please do not copy this tutorial without providing a link back to the original here.
Deutsche Übersetzung: Donzi © 2007
Seite 1: Einführung, Starten, Einstellungen, Vote, Firewall, Administration
Seite 2: LinuxStartscript
Seite 3: CustomMaps und CustomMutators, Map/GameMode-Voting mit BIA-Vote, Redirect (FastDownload)
Linux-Server Startscript
Eigentlich ist für den LinuxServer alles gleich, wie bei dem WindowsServers, ausser das Starten. Um es euch einfacher zu machen, haben wir ein Startscript gebastelt.
Mit diesem könnt ihr:
- den Server starten und stoppen
- den ServerStatus euch anzeigen lassen
- den Server checken, ob er läuft, wenn nein, wird er gestartet
- den Server debuggen. Der Server wird nicht in den Hintergrund gepackt, sondern direkt ausgeführt, um Probleme zu sehen und später zu beseitigen. Mit CTRL-D könnt Ihr den Debug-Modus wieder abschalten.
- restart funktioniert nicht ( würde da mal jemand drüberschauen ^^)
Code:
#!/bin/bash
###########################################################
#
# =========================================
# | DNW Despe Networks |
# =========================================
# |>>>>>>>> UT3 StartScript v2.2 >>>>>>|
# |>>>>>>>> http://www.despe.de >>>>>>>>>>|
# |>>>>>>>> DO NOT EDIT, only if u know>>>|
# |>>>>>>>> what are you doing! >>>>>>>>>>|
# =========================================
# by Donzi, Flip, jeppo, token
###########################################################
# which user runs the server, NOT ROOT!!
USER=
# Name of the Server, short discription
ACCID=UT3-iCTF
# GameSpy Login. Please Create a Login in your client, that update this setting!
MYLOGIN=
MYPASSWORD=
# Ports for the server
SERVERPORT=7777
QUERYPORT=6500
# where is the server installed
SERVERDIR="/home/~user/ut3"
# ServerIP for multihome, must be insert!
SERVERIP="83.142.84.124"
# Logs for the Server, found in /home/~user/ut3/UTGame/Logs/
LOG="$ACCID.log"
CRASHLOG="$ACCID.crash.log"
PIDFILE="$SERVERDIR/$ACCID.pid"
# where are your ini to generate and later for read
# you can find it in /UTGame/Config/yourdirectory
INIDIR=iCTF
#SERVERDESCRIPTION= set this in the UTgame.ini!
# ADMINPASSWORD= Sets an admin password
ADMINPASSWORD=
# GAMEPASSWORD= Sets a game password
GAMEPASSWORD=
# MAPS: DM-Heatray, DM-ShangriLa,VCTF-Suspense, CTF-Coret, War-Torlan
MAP=CTF-Coret
# GAMEMODE= Sets the gamemode (so servers will show up in the right catagory in the server browser) see above
# DM = 0
# CTF = 1
# Warfare = 2
# vCTF = 3
# TDM = 4
# Duel = 5
GAMEMODE=1
#GAME:
# DeatMatch = UTGame.UTDeathmatch
# CTF = UTGameContent.UTCTFGame_Content
# Warfare = UTGameContent.UTOnslaughtGame_Content
# vCTF = UTGameContent.UTVehicleCTFGame_Content
# TDM = UTGame.UTTeamGame
# Duel = UTGame.UTDuelGame
GAME=UTGameContent.UTCTFGame_Content
# MAXPLAYERS= Maximum number of players on the server (overrides ini setting)
MAXPLAYERS=10
# MINNETPLAYERS= Minimum number of players before a match starts (real players not bots)
MINPLAYERS=0
# BSHOULDADVERTISE=[True|False] Show the server in the server browser
INSERVERBROWSER=True
# BISLANMATCH=[False|False] Is this a LAN only game?
LANMATCH=False
# BUSESSTATS=[True|False] Report stats or not?
STATS=True
ALLOWJOININPROGRESS=True
ALLOWINVITES=True
USEPRESENCE=True
ALLOWJOINVIAPRESENCE=True
FORCERESPAWN=0
#NUMPLAY=0
# DEDICATED=[True|False] Changes dedicated server setting
DEDICATED=True
#BotSkill or Difficulty from 0-7
BOTSKILL=2
#Mutator loaded? If Yes, set to 0
PURESERVER=1
# GOALSCORE= Sets the max frags / max caps before the server will change maps.
GOALSCORE=0
# TIMELIMIT= Sets the timelimit in minutes for each map.
TIMELIMIT=20
# MUTATOR=
# UTGame.UTMutator_SlowTimeKills
# UTGame.UTMutator_BigHead
# UTGame.UTMutator_FriendlyFire
# UTGame.UTMutator_Handicap
# UTGame.UTMutator_Instagib
# UTGame.UTMutator_LowGrav
# UTGame.UTMutator_NoPowerups
# UTGame.UTMutator_NoTranslocator
# UTGame.UTMutator_Slomo
# UTGame.UTMutator_SpeedFreak
# UTGame.UTMutator_SuperBerserk
# UTGame.UTMutator_WeaponReplacement
# UTGame.UTMutator_WeaponsRespawn
#???? UTGame.UTMutator_Survival
LOADEDMUTATORS=UTGame.UTMutator_NoTranslocator,UTGame.UTMutator_Instagib
#########################################################################
# DONT EDIT BELOW THIS LINE!!! Broken Server is the reason !!! #
#########################################################################
SERVERSTART="Binaries/ut3"
SERVEREXE="./ut3-bin"
# Servercommandline
SERVERCOMMANDLINE="server $MAP?GameMode=$GAMEMODE?Game=$GAME?MinNetPlayers=$MINPLAYERS?MaxPlayers=$MAXPLAYERS?bShouldAdvertise=$INSERVERBROWSER?bIsLanMatch=$LANMATCH?bUsesStats=$STATS?bIsDedicated=$DEDICATED?PureServer=$PURESERVER?ForceRespawn=$FORCERESPAWN?GoalScore=$GOALSCORE?TimeLimit=$TIMELIMIT?bAllowJoinInProgress=$ALLOWJOININPROGRESS?bAllowInvites=$ALLOWINVITES?bUsesPresence=$USEPRESENCE?Mutator=$LOADEDMUTATORS?AdminPassword=$ADMINPASSWORD?GamePassword=$GAMEPASSWORD -configsubdir=$INIDIR -login=$MYLOGIN -password=$MYPASSWORD -port=$SERVERPORT -queryport=$QUERYPORT -multihome=$SERVERIP -log=$LOG -nohomedir -unattended"
#################################
# temporarily out of order
EXECMD="
while true
do
OLDDIR=`pwd`
cd $SERVEREXECDIR
$SERVERCOMMANDLINE
cd $OLDDIR
sleep 5
mv $LOG $CRASHLOG
done"
################################
# Checking if ut3 is there and executable
if [ -f "$SERVERDIR/$SERVERSTART" ]; then
if [ ! -x "$SERVERDIR/$SERVERSTART" ]; then
echo -e "$SERVERDIR/$SERVERSTART Datei ist nicht ausfuehrbar (chmod777)"
echo -e "Bitte aendern und nochmals starten"
exit 2
fi
else
echo "Kann die Datei $SERVERDIR/$SERVERSTART nicht finden!"
echo "Sollte das nicht stimmen, editiere mich."
exit 2
fi
# Check ut3-bin is there and executable.
if [ -f "$SERVERDIR/Binaries/$SERVEREXE" ]; then
if [ ! -x "$SERVERDIR/Binaries/$SERVEREXE" ]; then
echo -e "Binaries/$SERVEREXE Datei ist nicht ausfuehrbar (chmod777)"
echo -e "Bitte aendern und nochmals starten"
exit 2
fi
else
echo "Kann die Datei $SERVERDIR/$SERVERSTART nicht finden!"
echo "Sollte das nicht stimmen, editiere mich."
exit 2
fi
case "$1" in
start)
echo -n "Starte $ACCID dedicated server: "
if ps -ef |grep "$SERVEREXE $SERVERCOMMANDLINE"|awk -F" " -v game=${realbin} 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
echo -e "laeuft schon"
exit 0
else
if [ -f "$LOG" ]; then
cp $LOG $CRASHLOG
fi
if $SERVERDIR/$SERVERSTART $SERVERCOMMANDLINE 1>> $LOG 2>&1 & sleep 3 ; then
pid=`ps -ef |grep "$SERVEREXE $SERVERCOMMANDLINE"|awk -F" " -v game=$SERVEREXE 'BEGIN {status=1} ; $8 == game { print $2 } ; END {exit status}'`
echo ${pid} > $PIDFILE
if [ -f "$PIDFILE" ] && ps h `cat "$PIDFILE"` >/dev/null; then
echo -e "....Gestartet!"
exit 0
else
echo -e "....Konnte nicht gestartet werden. Ueberpruefe die Log-Datei oder starte mit debug!"
exit 1
fi
else
echo -e "Fehler!"
fi
fi
;;
stop)
echo -n "Stoppe $ACCID dedicated server: "
if ! ps -ef |grep "$SERVEREXE $SERVERCOMMANDLINE"|awk -F" " -v game=$SERVEREXE 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
echo -e "Server laeuft nicht oder ist abgestuerzt."
else
pid=`ps -ef |grep "$SERVEREXE $SERVERCOMMANDLINE"|awk -F" " -v game=$SERVEREXE 'BEGIN {status=1} ; $8 == game { print $2 } ; END {exit status}'`
echo ${pid} > $PIDFILE
kill -9 `cat $PIDFILE`
if ! ps -ef |grep $SERVERDIR/$SERVERSTART|awk -F" " -v game=$SERVERDIR/$SERVERSTART 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
rm -f $PIDFILE
echo -e "gestoppt"
exit 0
else
echo -e "Kann Server nicht stoppen oder er ist abgestuerzt"
fi
fi
;;
status)
echo -n "`date +"%Y-%m-%d %H:%M:%S"` Check $ACCID dedicated server status: "
if ! ps -ef |grep "$SERVEREXE $SERVERCOMMANDLINE"|awk -F" " -v game=$SERVEREXE 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
echo -e "Server laeuft nicht oder ist abgestuerzt... Starte den Server neu, Moment bitte"
$0 start
else
echo -e "Server laeuft, keine Aenderung."
fi
;;
check)
echo -n "Check $ACCID dedicated server status: "
if ! ps -ef |grep "$SERVEREXE $SERVERCOMMANDLINE"|awk -F" " -v game=$SERVEREXE 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
echo -e "offline"
else
echo -e "online"
fi
;;
restart)
echo -e "Neustart $ACCID dedicated server... "
$0 stop && sleep 3 && $0 start
;;
debug)
echo -n "Starting debug mode for $ACCID dedicated server: "
if ps -ef |grep "$SERVEREXE $SERVERCOMMANDLINE"|awk -F" " -v game=$SERVEREXE 'BEGIN {status=1} ; $8 == game {status=0} ; END {exit status}' ; then
echo -e "already active"
exit 3
else
echo "--DEBUG will appear on screen!"
echo "--Hit CTRL+C to kill the server!"
$SERVERDIR/$SERVERSTART $SERVERCOMMANDLINE
fi
;;
*)
echo "Usage: $0 {start|stop|restart|status|check|debug}"
exit 1
esac
Seite 1: Einführung, Starten, Einstellungen, Vote, Firewall, Administration
Seite 2: LinuxStartscript
Seite 3: CustomMaps und CustomMutators, Map/GameMode-Voting mit BIA-Vote, Redirect (FastDownload)
Copyright
This tutorial is copyright of its author.
Please do not copy this tutorial without providing a link back to the original here.
Deutsche Übersetzung: Donzi © 2007
|