updates to init and config script from Sergey Belyashov (bug #123930)
authorMichael Sterrett <mr_bones_@gentoo.org>
Wed, 5 Oct 2011 09:14:03 +0000 (09:14 +0000)
committerMichael Sterrett <mr_bones_@gentoo.org>
Wed, 5 Oct 2011 09:14:03 +0000 (09:14 +0000)
Package-Manager: portage-2.1.10.11/cvs/Linux i686

games-server/halflife-steam/ChangeLog
games-server/halflife-steam/Manifest
games-server/halflife-steam/files/hlds.confd
games-server/halflife-steam/files/hlds.rc

index c5804d557fce220ff2cf8439dbd474071c1526d0..a59e7b61d695c15403884764f7cc8c59fb7efadf 100644 (file)
@@ -1,6 +1,10 @@
 # ChangeLog for games-server/halflife-steam
-# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-server/halflife-steam/ChangeLog,v 1.11 2007/03/12 17:56:25 genone Exp $
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/games-server/halflife-steam/ChangeLog,v 1.12 2011/10/05 09:14:03 mr_bones_ Exp $
+
+  05 Oct 2011; Michael Sterrett <mr_bones_@gentoo.org> files/hlds.confd,
+  files/hlds.rc:
+  updates to init and config script from Sergey Belyashov (bug #123930)
 
   12 Mar 2007; Marius Mauch <genone@gentoo.org> halflife-steam-2.0.ebuild:
   Replacing einfo with elog
index da00a55aab4b74680b643e7780ed67ddfbfd1076..ca4892489a706a4e02334365785cb85da1787241 100644 (file)
@@ -1,6 +1,6 @@
-AUX hlds.confd 484 RMD160 ea23a7aa7ec7decb838b954adbb90026efd3a407 SHA1 588a33b4a40b45d95742bd13c0ddc2602034bd7e SHA256 a53f49749759dea8868aa8c02954e8bd4c2083ce9a87e2fb0ab451c5bbc51e3c
-AUX hlds.rc 925 RMD160 76962a1bf4c34d6a80158f2cd4e49c9161047b4c SHA1 5aa14e3cfa33821a1aa4239d7a66c6c691e16ce5 SHA256 661a998a95fea3ebf258d0db246152a39ef16cff1679f7a43cad12125bec0e84
+AUX hlds.confd 816 RMD160 e18429277e24cfe0ae8d8a02f849c66789f2fe8d SHA1 05f22cf7e825a17502c63cdf4957aee1c94d88ef SHA256 f337f212482e197b5f64ee796b8fa7f51173e0188cc328ec47318181e73500f2
+AUX hlds.rc 1689 RMD160 dbc6a5b3e50b05b6d01e3aa6eac944b623419943 SHA1 3343cfb9ea1b75b5914ead5b00572c1a60a7500b SHA256 f2eb16234c9892c210e1f63d5cecfe03389283c4321875ba72e25d77f1a4dcc5
 DIST hldsupdatetool.bin 3513408 RMD160 cb890cca0b79c94aea42e9d065c59ab0791d319e SHA1 3b8e0fcdd7375511f88556c3f8b698a28c93110f SHA256 dda8786ac0ce755acc3f307989641482a19de4b28801289b910a3bbcd097a6db
 EBUILD halflife-steam-2.0.ebuild 2017 RMD160 d9ebb7357980514ad2d0547673bdd8b6a90f65ff SHA1 6efe510484a69558b5cc8780ba22e0106f2436a7 SHA256 e878de46b2c29ec96063a576e017d13b678abb2280991811f05dc8f5eaaf688b
-MISC ChangeLog 1187 RMD160 f446f229158e7bba2857b031e72b82fac5669cb5 SHA1 41bdae74fe19731949d34cef6a8d50b9291e9e17 SHA256 bcb90dd98ea6e650d049dfb1d93d02e50d55ea6d29e1f1c0c3675ded1dbad2d3
+MISC ChangeLog 1353 RMD160 c121548c4f3933272f8a6e08511be02365a5900c SHA1 82a9e3e5e5286f405ffb2e9b1e389c0777c95308 SHA256 e574e98b630814111514c352a5bda1655bc51014551d9bb36f45aff94f51cabd
 MISC metadata.xml 158 RMD160 cbd9984bb6b426c8c9cee5022fe0a26261612fea SHA1 be5251fa1dacef5c41b74761bb1c8c54fb633b9e SHA256 1423a4fdd4a79b1728a2056d9e300f7e1074253095d82726218d9e9b953888a3
index ccea142ce1e1dcd1dad8c8f4951b52e2d7ba0e1e..d27b0cbb16ab2c8bbe8260e97bcd0337961f66dd 100644 (file)
@@ -10,5 +10,12 @@ HLDS_PATH="@GAMESDIR@"
 #  srcds_i686  on most x86 systems
 #HLDS_MT="srcds_i686"
 
-# Here you can set your start options like game type and maxplayers ...
-HLDS_OPTS="-console -port 27015 -game cstrike +map de_dust +maxplayers 6"
+# Here you can set your common start options...
+HLDS_OPTS="-console +maxplayers 32"
+
+# Here you can setup more than one server
+# You should for each server create variable HLDS_SERVER<N> (where <N> positive decimal number)
+# When you have enabled SERVER1 and SERVER3 then only first will be started
+HLDS_SERVER1="-game cstrike -port 27015 +map de_dust2"
+#HLDS_SERVER2="-game cstrike +ip a.b.c.d -port 27015 +map de_aztec15"
+#HLDS_SERVER3="-game cstrike +ip a.b.c.d -port 27016"
index 14720fe0cec13bc1f1edb27fb0809ccce8fc279d..a03690b947b49e7d3d7a89eff900c319699de996 100644 (file)
@@ -1,7 +1,9 @@
 #!/sbin/runscript
-# Copyright 1999-2005 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/games-server/halflife-steam/files/hlds.rc,v 1.1 2005/11/16 03:24:56 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-server/halflife-steam/files/hlds.rc,v 1.2 2011/10/05 09:14:03 mr_bones_ Exp $
+
+PID_PATH="/var/run"
 
 depend() {
        use net
@@ -18,21 +20,56 @@ checkconfig() {
        return 0
 }
 
-start() {
-       checkconfig || return $?
+start_server() {
+       local serv_num=$1
+       local serv_opts="`eval echo '$'HLDS_SERVER${serv_num}`"
+       local PID1=${PID_PATH}/hlds${serv_num}_1.pid
+       local PID2=${PID_PATH}/hlds${serv_num}_2.pid
+       rm -f $PID1 $PID2
 
-       ebegin "Starting Halflife Dedicated Server"
-       export LD_LIBRARY_PATH=${HLDS_PATH}:${HLDS_PATH}/bin:${LD_LIBRARY_PATH}
+       test $serv_num != 1 -a -z "$serv_opts" && return 1
+
+       ebegin "Starting Halflife Dedicated Server $serv_num"
+       touch ${PID2}
+       chown @GAMES_USER@:@GAMES_GROUP@ ${PID2}
        start-stop-daemon --start \
                --chdir ${HLDS_PATH} -c @GAMES_USER@:@GAMES_GROUP@ \
                -n ${HLDS_MT} -b -a ${HLDS_PATH}/${HLDS_MT} \
+               -m --pidfile ${PID1} \
                -- \
-               -pidfile /var/run/hlds.pid ${HLDS_OPTS}
+               -pidfile ${PID2} ${HLDS_OPTS} ${serv_opts}
        eend $?
 }
 
+stop_server() {
+       local serv_num=$1
+       local PID1=${PID_PATH}/hlds${serv_num}_1.pid
+       local PID2=${PID_PATH}/hlds${serv_num}_2.pid
+       if test -f ${PID1} -a -f ${PID2}; then
+               ebegin "Stopping Halflife Dedicated Server $serv_num"
+               start-stop-daemon --stop --pidfile ${PID1}
+               start-stop-daemon --stop --pidfile ${PID2}
+               eend $?
+               rm -f $PID1 $PID2
+       else
+               return 1
+       fi
+       return 0
+}
+
+start() {
+       checkconfig || return $?
+
+       export LD_LIBRARY_PATH=${HLDS_PATH}:${HLDS_PATH}/bin:${LD_LIBRARY_PATH}
+       local i=1
+       while start_server $i; do
+               i=$(($i+1))
+       done
+}
+
 stop() {
-       ebegin "Stopping Halflife Dedicated Server"
-       start-stop-daemon --stop --pidfile /var/run/hlds.pid
-       eend $?
+       local i=1
+       while stop_server $i; do
+               i=$(($i+1))
+       done
 }