#!/bin/sh
#
# depagt    This shell script takes care of starting and stopping
#            depagtd (Target On Linux cilent service).
#
# chkconfig: 35 99 99
# description: depagt - Target On Linux client service
# processname: depagtd

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

BASEDIR=/usr/nec/dpm/agent

#Module Check
[ -f ${BASEDIR}/bin/depagtd ] || exit 1
[ -f ${BASEDIR}/etc/server.inf ] || exit 1

# See how we were called.
case "$1" in
  start)
        echo -n "Starting depagtd services: "
        daemon ${BASEDIR}/bin/depagtd

        echo
        touch /var/lock/subsys/depagt
        ;;
  stop)
        echo -n "Stopping depagtd services: "
        killproc ${BASEDIR}/bin/depagtd

        echo
        rm -f /var/lock/subsys/depagt
        ;;
  status)
        status ${BASEDIR}/bin/depagtd
        ;;
  restart|reload)
        $0 stop
        $0 start
        ;;
  *)
        echo "Usage: skelton {start|stop|status|restart}"
        exit 1
esac

exit 0
