ansible-fprobe/templates/init.d-fprobe.j2

54 lines
973 B
Plaintext
Raw Normal View History

2016-10-30 20:40:48 +01:00
#!/bin/bash
#
# /etc/rc.d/init.d/fprobe-ulog
#
# NetFlow probe
# chkconfig: 2345 10 90
# description: Netflow Probe
# config: /etc/sysconfig/fprobe
[ -f /etc/sysconfig/fprobe ] && . /etc/sysconfig/fprobe
# Source function library. = redirect to systemd...
#. /etc/init.d/functions
start() {
2017-01-07 09:55:05 +01:00
echo -n "Starting fprobe-ulog"
2016-10-30 20:40:48 +01:00
fprobe-ulog -c /var/tmp $FLOW_COLLECTOR
touch /var/lock/subsys/fprobe-ulog
2017-01-07 09:55:05 +01:00
echo .
ps axu | egrep '[f]probe-ulog'
2016-10-30 20:40:48 +01:00
return 0
}
stop() {
2017-01-07 09:55:05 +01:00
echo -n "Shutting down fprobe-ulog"
2016-10-30 20:40:48 +01:00
pkill fprobe-ulog
rm -f /var/lock/subsys/fprobe-ulog
2017-01-07 09:55:05 +01:00
echo .
2016-10-30 20:40:48 +01:00
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
ps axu | egrep '[f]probe-ulog'
;;
restart)
stop
start
;;
*)
echo "Usage: fprobe-ulog {start|stop|status|restart}"
exit 1
;;
esac
exit $?