]> git.pld-linux.org Git - packages/demarc.git/blob - demarc.init
- drop obsolete and outdated manual inclusion of rpm macros
[packages/demarc.git] / demarc.init
1 #!/bin/sh
2 #
3 # demarcd       Network monitoring daemon
4 #
5 # chkconfig:    345 96 50
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.
19 if is_yes "${NETWORKING}"; then
20         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
21                 msg_network_down demarcd
22                 exit 1
23         fi
24 else
25         exit 0
26 fi
27
28 RETVAL=0
29 # See how we were called.
30 case "$1" in
31   start)
32         # Check if the service is already running?
33         if [ ! -f /var/lock/subsys/demarcd ]; then
34                 msg_starting demarcd
35                 daemon demarcd
36                 RETVAL=$?
37                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/demarcd
38         else
39                 msg_already_running demarcd
40         fi
41         ;;
42   stop)
43         # Stop daemons.
44         if [ -f /var/lock/subsys/demarcd ]; then
45                 msg_stopping demarcd
46                 killproc demarcd -TERM
47                 rm -f /var/lock/subsys/demarcd > /dev/null 2>&1
48         else
49                 msg_not_running demarcd
50         fi
51         ;;
52   status)
53         status demarcd
54         exit $?
55         ;;
56   restart|force-reload)
57         $0 stop
58         $0 start
59         exit $?
60         ;;
61   *)
62         msg_usage "$0 {start|stop|restart|force-reload|status}"
63         exit 3
64 esac
65
66 exit $RETVAL
This page took 0.064903 seconds and 3 git commands to generate.