#!/sbin/openrc-run
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
	need net
}

start() {
	ebegin "Starting RTCW dedicated server..."
	screen -A -m -d -S rtcw su - dedicated -c GENTOO_DIR/startwolfded
	eend $?
}

stop() {
	ebegin "Stopping RTCW dedicated server..."
	kill `screen -list | grep rtcw | awk -F . '{ print $1 }' | sed -e s/.//`
	eend $?

}

status() {
	screen -list | grep rtcwded
}
