#!/bin/sh
#
# faxq ax       This shell script takes care of starting and stopping
#               hylafax queues.
#
# chkconfig: - 95 05
# description: faxq starts/stops hylafax queue.
#

# 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/faxq ] || exit 0

[ -f /usr/libexec/fax/hfaxd ] || exit 0

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

exit 0
