#!/bin/sh
#
# ddtcd           This shell script takes care of starting and stopping
#                 ddtcd (client side DDT daemon).
#
# chkconfig: 2345 87 18
# description: DDT is a client/server application that enables \
# name server update for client using dynamic IPs.
# probe: true

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

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/sbin/ddtcd ] || exit 0

[ -f /etc/ddtcd.conf ] || exit 0

# See how we were called.
case "$1" in
  start)
        # Start daemons.
        echo -n "Starting ddtcd: "
        daemon /usr/sbin/ddtcd
        echo
        touch /var/lock/subsys/ddtcd
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down ddtcd: "
        killproc ddtcd
        rm -f /var/lock/subsys/ddtcd
        echo
        ;;
  restart)
	# Restart daemons.
	$0 stop
	$0 start
	;;
  *)
        echo "Usage: ddtcd {start|stop|restart}"
        exit 1
esac

exit 0
