]> git.pld-linux.org Git - packages/autopsy.git/blob - autopsy.init
- drop obsolete and outdated manual inclusion of rpm macros
[packages/autopsy.git] / autopsy.init
1 #!/bin/sh
2 #
3 # autopsy       This shell script takes care of starting and stopping
4 #               Autopsy (The Sleuth Kit web interface).
5 #
6 # chkconfig:    345 92 15
7 # description:  Autopsy is a web interface for The Sleuth Kit
8
9 # Source function library.
10 . /etc/rc.d/init.d/functions
11
12 # Source networking configuration.
13 . /etc/sysconfig/network
14
15 # Check that networking is up.
16 if is_yes "${NETWORKING}"; then
17         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
18                 msg_network_down autopsy
19                 exit 1
20         fi
21 else
22         exit 0
23 fi
24
25
26 start() {
27         # Check if the service is already running?
28         if [ ! -f /var/lock/subsys/autopsy ]; then
29                 msg_starting autopsy
30                 daemon --user autopsy --fork --waitfortime 1 /usr/bin/autopsy 
31                 RETVAL=$?
32                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/autopsy
33         else
34                 msg_already_running autopsy
35         fi
36 }
37
38 stop() {
39         if [ -f /var/lock/subsys/autopsy ]; then
40                 msg_stopping autopsy
41                 killproc autopsy
42                 rm -f /var/lock/subsys/autopsy
43         else
44                 msg_not_running autopsy
45         fi
46 }
47
48 condrestart() {
49         if [ -f /var/lock/subsys/autopsy ]; then
50                 stop
51                 start
52         else
53                 msg_not_running autopsy
54                 RETVAL=$1
55         fi
56 }
57
58 RETVAL=0
59 # See how we were called.
60 case "$1" in
61   start)
62         start
63         ;;
64   stop)
65         stop
66         ;;
67   restart)
68         stop
69         start
70         ;;
71   try-restart|condrestart)
72         condrestart 0
73         ;;
74   force-reload)
75         condrestart 7
76         ;;
77   status)
78         status autopsy
79         exit $?
80         ;;
81   *)
82         msg_usage "$0 {start|stop|restart|try-restart|force-reload|condrestart|status}"
83         exit 3
84 esac
85
86 exit $RETVAL
This page took 0.061324 seconds and 3 git commands to generate.