#!/bin/bash
# catfish
#
# chkconfig: 2345 93 14
# description: catfish - Schedule download program for CacheServer.
# processname: catfish
# pidfile: /var/run/catfish.pid
# config: /opt/nec/catfish/catfish.dll

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

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

# check if the squid conf file is present
[ -f /opt/nec/catfish/catfish.dll ] || exit 0


case "$1" in
start)
    echo -n "Starting catfish: "
    /opt/nec/catfish/catfish -start
    ;;

stop)
    echo -n "Stopping catfish: "
    /opt/nec/catfish/catfish -stop
#    echo "done"
    ;;

restart)
    /opt/nec/catfish/catfish -reconfigure 
    exit $?
    ;;

*)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
esac

exit 0
