#!/bin/sh
# This is a generated script for starting, stopping and restarting a service.
#
# USAGE: OVTrcSrv start|stop|restart
#
#        start:   Starts the service
#        stop:    Stops the service
#        restart: Restarts the service
#
# (c) Copyright 2003 Hewlett-Packard Development Company, L.P.

usage()
{
    echo "USAGE: OVTrcSrv start|stop|restart" 1>&2
    exit 1
}

start_service()
{
    (umask 002; /opt/OV/lbin/xpl/trc/ovtrcd)
    return $?
}

stop_service()
{
    /opt/OV/support/ovtrcadm -srvshutdown > /dev/null 2>&1
    return $?
}

restart_service()
{
    $0 stop; $0 start
    return $?
}

if [ $# -ne 1 ]; then
    usage
fi

case $1 in
    start)
        echo "Starting OVTrcSrv..."
        start_service
        exit $?
        ;;
    stop)
        echo "Stopping OVTrcSrv..."
        stop_service
        exit $?
        ;;
    restart)
        restart_service
        exit $?
        ;;
    *)
        usage
        ;;
esac
