1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #!/bin/bash
- #
- # softflowd Starts softflowd NetFlow probe
- # $Id$
- #
- # chkconfig: 2345 95 02
- # description: Starts and stops the softflowd Netflow probe
- # Source function library.
- . /etc/init.d/functions
- SOFTFLOW_CONF=/etc/sysconfig/softflowd
- SOFTFLOW_LOCK=/var/lock/subsys/softflowd
- SOFTFLOW_PROG=/usr/sbin/softflowd
- SOFTFLOW_OPTS="-i eth0"
- # Source config
- if [ -f $SOFTFLOW_CONF ]; then
- . $SOFTFLOW_CONF
- fi
- [ -x $SOFTFLOW_PROG ] || exit 0
- RETVAL=0
- start() {
- echo -n $"Starting softflowd: "
- daemon $SOFTFLOW_PROG $SOFTFLOW_OPTS
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch $SOFTFLOW_LOCK
- return $RETVAL
- }
- stop() {
- echo -n $"Shutting down softflowd: "
- killproc $SOFTFLOW_PROG
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && rm -f $SOFTFLOW_LOCK
- return $RETVAL
- }
- restart() {
- stop
- start
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- status)
- status $SOFTFLOW_PROG
- ;;
- restart|reload)
- restart
- ;;
- condrestart)
- [ -f $SOFTFLOW_LOCK ] && restart || :
- ;;
- *)
- echo $"Usage: $0 {start|stop|status|restart|condrestart}"
- exit 1
- esac
- exit $?
|