]> git.pld-linux.org Git - packages/demarc.git/blame - demarc.init
- drop obsolete and outdated manual inclusion of rpm macros
[packages/demarc.git] / demarc.init
CommitLineData
d6b368b7
AM
1#!/bin/sh
2#
3# demarcd Network monitoring daemon
4#
90e19b1e 5# chkconfig: 345 96 50
d6b368b7
AM
6# description: Netowk monitoring daemon which uses snort as NIDS
7#
8
9# Source function library
10. /etc/rc.d/init.d/functions
11
12# Get network config
13. /etc/sysconfig/network
14
15# Get service config
16[ -f /etc/sysconfig/demarcd ] && . /etc/sysconfig/demarcd
17
18# Check that networking is up.
19if is_yes "${NETWORKING}"; then
04d94818 20 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
27e3a9cd 21 msg_network_down demarcd
22 exit 1
23 fi
d6b368b7 24else
27e3a9cd 25 exit 0
d6b368b7
AM
26fi
27
8c7eaf8a 28RETVAL=0
d6b368b7
AM
29# See how we were called.
30case "$1" in
31 start)
32 # Check if the service is already running?
27e3a9cd 33 if [ ! -f /var/lock/subsys/demarcd ]; then
d6b368b7
AM
34 msg_starting demarcd
35 daemon demarcd
27e3a9cd 36 RETVAL=$?
37 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/demarcd
d6b368b7 38 else
27e3a9cd 39 msg_already_running demarcd
d6b368b7
AM
40 fi
41 ;;
42 stop)
27e3a9cd 43 # Stop daemons.
d6b368b7 44 if [ -f /var/lock/subsys/demarcd ]; then
27e3a9cd 45 msg_stopping demarcd
46 killproc demarcd -TERM
47 rm -f /var/lock/subsys/demarcd > /dev/null 2>&1
48 else
55323618 49 msg_not_running demarcd
d6b368b7
AM
50 fi
51 ;;
52 status)
53 status demarcd
8c7eaf8a 54 exit $?
d6b368b7 55 ;;
8c7eaf8a 56 restart|force-reload)
d6b368b7
AM
57 $0 stop
58 $0 start
8c7eaf8a 59 exit $?
d6b368b7
AM
60 ;;
61 *)
8c7eaf8a 62 msg_usage "$0 {start|stop|restart|force-reload|status}"
63 exit 3
d6b368b7
AM
64esac
65
66exit $RETVAL
This page took 0.077249 seconds and 4 git commands to generate.