#!/bin/bash

# Copyright (C) 2002,2003,2004 Open Source Development Lab
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
. /etc/init.d/functions

# start up testsystem
#
# chkconfig: 3 99 99
# description: Just start up testsystem.

RETVAL=0

start() {
        echo -n "Starting testsystem: "
        /usr/bin/testsystem_d -u testsys >> /dev/null 2>> /dev/null &
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/testsystem
        [ $RETVAL -eq 0 ] && echo_success || echo_failure
        echo
}

stop() {
        echo -n "Shutting down testsystem: "
        killproc testsystem_d
        RETVAL=$?
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/testsystem
        echo
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart|reload)
        stop
        start
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
esac

exit $RETVAL
