#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/games-server/halflife-dpb/files/hlds-dpb.rc,v 1.2 2004/07/14 22:17:40 agriffis Exp $ depend() { need net } start() { ebegin "Starting halflife dpb dedicated" screen -A -m -d -S hlds-dpb su - GENTOO_GAMES_USER -c "GENTOO_DIR/hlds-dpb ${HLDS_OPTS}" & eend $? } stop() { ebegin "Stopping halflife dpb dedicated" local ppid=`screen -list | grep hlds-dpb | awk -F . '{ print $1 }' | sed -e s/.//` if [ -z "${ppid}" ] ; then eend 1 "Lost screen session" else local cpid=`pstree -p ${ppid} | sed -e 's:^.*hlds_run(::' -e 's:).*$::'` kill ${ppid} ${cpid} eend $? "Could not kill hlds-dpb" fi }