#!/bin/sh
#

case "$1" in
start)
	if [ -x /usr/local/quakeserver/unixded ]
	then
		echo /usr/local/quakeserver/qserver.sh | su -m quakerun \
			&& echo -n ' quakeserver'
	fi
	;;
stop)
	echo killall unixded | su -m quakerun && echo -n ' quakeserver'
	;;
*)
	echo "Usage: `basename $0` {start|stop}" >&2
	exit 64
	;;
esac

exit 0
