#!/bin/sh
#
# ax25d         This shell script takes care of starting and stopping
#               the ax25-tools ax25d daemon.
#
# chkconfig: - 96 04
# description: ax25-tools ax25d daemon

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

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

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

DAEMON=ax25d

# See how we were called.
case "$1" in
  start)
        # Start daemons.
        echo -n "Starting $DAEMON: "
        daemon $DAEMON
	RETVAL=$?
        echo
        touch /var/lock/subsys/$DAEMON
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down $DAEMON: "
	killproc $DAEMON
	RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$DAEMON
        ;;
  status)
	status $DAEMON
	RETVAL=$?
	;;
  restart|reload)
	$0 stop
	$0 start
	RETVAL=$?
	;;
  *)
        echo "Usage: $DAEMON {start|stop|restart|status}"
        exit 1
esac

exit $RETVAL
