--- /dev/null
+#!/bin/sh
+#
+# cr conferenceroom ircd service
+#
+# chkconfig: 345 11 89
+#
+# description: conferenceroom ircd service
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+SERVICES="cr ws sv"
+PROGDIR=/usr/lib/cr
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/cr ] && . /etc/sysconfig/cr
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+ msg_network_down cr
+ exit 1
+ fi
+else
+ exit 0
+fi
+
+start() {
+ # Check if the service is already running?
+ if [ ! -f /var/lock/subsys/cr ]; then
+ msg_starting "Conference Room IRCD"
+ set -x
+ daemon /usr/lib/cr/programs/launcher /usr/lib/cr $SERVICES
+# daemon /usr/lib/cr/programs/launcher /etc/cr $SERVICES
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cr
+ else
+ msg_already_running "Conference Room IRCD"
+ fi
+}
+
+stop() {
+ if [ -f /var/lock/subsys/cr ]; then
+ # Stop daemons.
+ msg_stopping "Conference Room IRCD"
+ killproc ConfRoom
+ killproc WMws
+# set -x
+# cd /usr/lib/cr
+# /usr/lib/cr/programs/ConfRoom -stop
+# rc=$?
+# /usr/lib/cr/programs/WMws -stop
+# rc=$((rc + $?))
+# [ "$rc" = 0 ] && ok || fail
+ rm -f /var/lock/subsys/cr
+ else
+ msg_not_running "Conference Room IRCD"
+ fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ exit $?
+ ;;
+ status)
+ status cr
+ RETVAL=$?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|status}"
+ exit 3
+esac
+
+exit $RETVAL