diff options
author | Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> | 2001-10-26 22:19:04 +0000 |
---|---|---|
committer | Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org> | 2001-10-26 22:19:04 +0000 |
commit | 2fdb7d93fda7cb83075785a788df1018589c285b (patch) | |
tree | d326e15127e8789ef9d867282aaef430c4ac0d6c /games/utserver-asu/files | |
parent | o make all installation user writable; otherwise, nothing works (diff) |
o asu-main.sh patch
o legacy-asu-script-0.1.sh patch
o ucc.init patch, root can start server with different userid
o remove both netgames-0.8.0 and old CSHP patches
o add CSHP4+ and asu-0.4-redirectfix patches
Submitted by: MAINTAINER
Notes
Notes:
svn path=/head/; revision=49244
Diffstat (limited to 'games/utserver-asu/files')
-rw-r--r-- | games/utserver-asu/files/patch-Lib:asu-main.sh | 73 | ||||
-rw-r--r-- | games/utserver-asu/files/ucc.init | 117 |
2 files changed, 190 insertions, 0 deletions
diff --git a/games/utserver-asu/files/patch-Lib:asu-main.sh b/games/utserver-asu/files/patch-Lib:asu-main.sh new file mode 100644 index 000000000000..ee8c3fb15a74 --- /dev/null +++ b/games/utserver-asu/files/patch-Lib:asu-main.sh @@ -0,0 +1,73 @@ +--- Lib/asu-main.sh Thu Oct 18 16:33:54 2001 ++++ Lib/asu-main.sh Thu Oct 18 16:35:01 2001 +@@ -8,6 +8,8 @@ + # + # Copyright (C) 2001 abfackeln@abfackeln.com + # ++# FreeBSD modifications by matuska@wu-wien.ac.at ++# + # This program is free software; you can redistribute it and/or + # modify it under the terms of the GNU General Public License + # as published by the Free Software Foundation; either version 2 +@@ -32,9 +34,9 @@ + Install_Package () + { + if [ -f "$PATCH_DIR/$1-patch.tar.gz" ]; then +- pushd $UT_DIR > /dev/null ++ /bin/csh -c pushd $UT_DIR > /dev/null 2> /dev/null + tar zxpf "$PATCH_DIR/$1-patch.tar.gz" +- popd > /dev/null ++ /bin/csh -c popd > /dev/null 2> /dev/null + if [ -f "$UT_DIR/$1-install.asu" ]; then + TMP=`head -1 "$UT_DIR/$1-install.asu" | sed -n -e "s/#~asu \([0-9.]*\).*$/\\\\1/" -e "t label" -e "d" -e ": label" -e "p"` + if [ -f "$ABF_DIR/legacy-asu-script-$TMP.sh" ]; then +@@ -1545,9 +1547,9 @@ + echo + echo "Zip and Umod files in your game directory:" + echo +- pushd $UT_DIR > /dev/null ++ /bin/csh -c pushd $UT_DIR > /dev/null 2> /dev/null + ls *.[zZ][iI][pP] *.[uU][mM][oO][dD] 2> /dev/null +- popd > /dev/null ++ /bin/csh -c popd > /dev/null 2> /dev/null + echo + echo "Enter the name of the file from the above list" + echo "or enter the full file name if it is located elsewhere." +--- Lib/legacy-asu-script-0.1.sh Sat Jun 23 02:46:49 2001 ++++ Lib/legacy-asu-script-0.1.sh Thu Oct 18 18:01:54 2001 +@@ -1,10 +1,29 @@ + #~asu 0.4 + #~legacy 0.1 ## compatability functions for version 0.1 scripts + +-AddIni () { IniAdd "$1" "$2" "$3" "$4" } +-UnAddIni () { IniUnAdd "$1" "$2" "$3" "$4" } +-SetIni () { IniSet "$1" "$2" "$3" "$4" } +-UnSetIni () { IniUnSet "$1" "$2" "$3" } +-MatchIni () { IniMatch "$1" "$2" "$3" "$4" } +-ReadIni () { IniRead "$1" "$2" "$3" } ++AddIni() ++{ ++ IniAdd "$1" "$2" "$3" "$4" ++} + ++UnAddIni() { ++IniUnAdd "$1" "$2" "$3" "$4" ++} ++ ++SetIni() ++{ ++IniSet "$1" "$2" "$3" "$4" ++} ++ ++UnSetIni() ++{ ++IniUnSet "$1" "$2" "$3" ++} ++ ++MatchIni() { ++IniMatch "$1" "$2" "$3" "$4" ++} ++ ++ReadIni() { ++IniRead "$1" "$2" "$3" ++} diff --git a/games/utserver-asu/files/ucc.init b/games/utserver-asu/files/ucc.init new file mode 100644 index 000000000000..eca6ff670817 --- /dev/null +++ b/games/utserver-asu/files/ucc.init @@ -0,0 +1,117 @@ +#!/bin/sh +# +# standard format startup script for unreal tournament +# +# written by abfackeln@abfackeln.com +# 2001-02-19 +# +# modified (FreeBSD) by matuska@wu-wien.ac.at +# 2001-10-20 +# +###################################################### + +MYNAME="ucc-DM" + +MYGAME="Botpack.DeathMatchPlus" +MYMAP="DM-Barricade" +MYUSERID="nobody" +MYDIR="/usr/games/ut-server" +MYPORT="7777" +MYIP="" +MYMODS="" +MYINI="UnrealTournament.ini" + +MYLOGFILE="$MYDIR/System/$MYNAME.log" +MYLOCKFILE="$MYDIR/System/$MYNAME.lock" + + +# no user servicable parts beyond this point + + +if [ -z "$MYMODS" ]; then + TMP="$MYMAP""\?game=$MYGAME" +else + TMP="$MYMAP""\?game=$MYGAME""\?mutator=$MYMODS" +fi +if [ -n "$MYIP" ]; then + TMP="$TMP multihome=$MYIP" +fi + +MYEXECMD="./ucc server $TMP -nohomedir ini=$MYINI log=$MYLOGFILE" +if [ `whoami` = "root" ]; then + SUID="/usr/bin/su $MYUSERID -c" +else + SUID= +fi + +ulimit -c 0 + +case "$1" in + start) + echo -n "Starting Unreal Tournament: " + if [ -f $MYLOCKFILE ]; then + echo "already running according to $MYLOCKFILE. Not started." + else + cd $MYDIR + if [ -n "$SUID" ]; then + $SUID "$MYEXECMD > /dev/null & echo \$! > $MYLOCKFILE" > /dev/null & + else + /bin/sh -c "$MYEXECMD & echo \$! > $MYLOCKFILE" > /dev/null & + fi + echo "$MYNAME" + fi + ;; + stop) + echo -n "Stopping Unreal Tournament: " + if [ ! -f $MYLOCKFILE ]; then + echo "not found" + exit 2 + fi + kill -TERM `cat $MYLOCKFILE` + rm -f $MYLOCKFILE + echo "$MYNAME" + ;; + restart) + if [ -f $MYLOCKFILE ]; then + $0 stop + fi + $0 start + ;; + check) + ## the next condition was devised by Chris Weiss for his ut-check script + ## ftp://xplug.sourceforge.net/pub/xplug/ut-check.tar.gz + ## i have slightly modified it and integrated it here + + ## usage: call "ucc.init check" from a cron task every 5 minutes or so + ## output will be nothing if it was running + ## else output will be a start message and the server will restart + + if [ -z "$(ps --no-headers -p $(cat $MYLOCKFILE 2>/dev/null) 2>/dev/null)" ]; then + $0 restart + fi + ;; + infinity) + ## infinite loop to ensure that server is always up without use of cron + + echo $$ > $MYLOCKFILE.8 + ## the number 8 is the infinity symbol sideways ;) -abf. + + while [ 1 ]; do + $0 check + sleep 60 + done + ;; + die) + $0 stop + + ## break infinity + kill -TERM `cat $MYLOCKFILE.8` + rm -f $MYLOCKFILE.8 + ;; + *) + echo "Usage: $0 {start|stop|restart|check|infinity|die}" + exit 1 +esac + +exit 0 + |