Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 5d014bfe7613411f1e91987741604167 > files > 1

halfd-2.10-1mdk.noarch.rpm

#!/bin/sh
#
# half: Manages Half-Life Server
#
# chkconfig: 345 90 10
# description: Starts and stops halfd daemon
HLDIR=/usr/local/hlds_l
HLUSER=hladmin
MODLIST='cstrike valve'
export HLDIR HLUSER MODLIST

# source function library
. /etc/rc.d/init.d/functions

start() {
	echo -n "Starting halfd: "
	for mod in $MODLIST; do
		su -l $HLUSER -c "halfd $mod &"
	done
	RETVAL=$?
	touch /var/lock/subsys/half
	echo
}

stop() {
    echo -n "Shutting down halfd: "
	killproc halfd
	RETVAL=$?
	rm -f /var/lock/subsys/half
	echo
}

RETVAL=0

# See how we were called.
case "$1" in
  start)
      start
      ;;
  stop)
      stop
      ;;
  status)
      status halfd
      ;;
   *)
	echo "*** Usage: $0 {start|stop|status}"
	exit 1
esac

exit $RETVAL