]> git.pld-linux.org Git - packages/fakebo.git/blob - fakebo.init
- tabs in preamble
[packages/fakebo.git] / fakebo.init
1 #!/bin/sh
2 #
3 # fakebo        This shell script takes care of starting and stopping
4 #               fakebo (trojan server fake daemon).
5 #
6 # chkconfig:    345 95 06
7 #
8 # description:  FakeBO fakes trojan server responses (Back Orifice, \
9 #               NetBus, etc.) and logs every attempt to a logfile or stdout.
10
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 # Get network config
16 . /etc/sysconfig/network
17
18 # Get service config - may override defaults
19 [ -f /etc/sysconfig/fakebo ] && . /etc/sysconfig/fakebo
20
21 # Check that networking is up.
22 if is_yes "${NETWORKING}"; then
23         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
24                 msg_network_down fakebo
25                 exit 1
26         fi
27 else
28         exit 0
29 fi
30
31 RETVAL=0
32 # See how we were called.
33 case "$1" in
34   start)
35         # Check if the service is already running?
36         if [ ! -f /var/lock/subsys/fakebo ]; then
37                 msg_starting fakebo
38                 daemon fakebo -b
39                 RETVAL=$?
40                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/fakebo
41         else
42                 msg_already_running fakebo
43         fi
44         ;;
45   stop)
46         # Stop daemons.
47         if [ -f /var/lock/subsys/fakebo ]; then
48                 msg_stopping fakebo
49                 killproc fakebo
50                 rm -f /var/lock/subsys/fakebo >/dev/null 2>&1
51         else
52                 msg_not_running fakebo
53         fi
54         ;;
55   restart|force-reload)
56         $0 stop
57         $0 start
58         exit $?
59         ;;
60   status)
61         status fakebo
62         exit $?
63         ;;
64   *)
65         msg_usage "$0 {start|stop|restart|force-reload|status}"
66         exit 3
67 esac
68
69 exit $RETVAL
This page took 0.057833 seconds and 3 git commands to generate.