summaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
authorroot <root@dgi-huset.dk>2012-04-10 00:51:34 +0200
committerroot <root@dgi-huset.dk>2012-04-10 00:51:34 +0200
commit6e0c34caad982aea1a6ad874589e04eb34857aa9 (patch)
treed4c1d98c1b41b71d4575e69d99d43e11af7a0e6a /init.d
parenta7ad206e9777ffbffc5700f1099950b0362604a6 (diff)
Add local flowscan SysV init script.
Diffstat (limited to 'init.d')
-rwxr-xr-xinit.d/local-flowscan47
1 files changed, 47 insertions, 0 deletions
diff --git a/init.d/local-flowscan b/init.d/local-flowscan
new file mode 100755
index 0000000..171e20f
--- /dev/null
+++ b/init.d/local-flowscan
@@ -0,0 +1,47 @@
+#!/bin/sh -e
+#
+# flowscan Transforms Cisco netflow files into rrd files.
+#
+# chkconfig: 345 20 20
+#
+# description: Start / stop the netflow recorder
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/bin/flowscan
+CONFIG=/etc/flowscan/flowscan.cf
+DESC="netflow recorder"
+
+test -f $DAEMON || exit 0
+test -f $CONFIG || exit 0
+
+startstop() {
+ local background=
+ [[ "$1" != "--start" ]] || background="--background"
+ start-stop-daemon "$@" $background --make-pidfile --name ${DAEMON##*/} \
+ --pidfile="/var/run/${DAEMON##*/}.pid" --startas "$DAEMON"
+}
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC: "
+ startstop --start
+ echo "${DAEMON##*/}."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: "
+ startstop --stop
+ echo "${DAEMON##*/}."
+ ;;
+ restart|force-reload)
+ echo -n "Reloading $DESC: "
+ startstop --stop --oknodo --quiet
+ startstop --start
+ echo "${DAEMON##*/}."
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0