]> git.pld-linux.org Git - packages/fakebo.git/blob - fakebo.init
- cleaning
[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 ]; then
24                 # nls "ERROR: Networking is down. %s can't be run." fakebo
25                 msg_network_down fakebo
26                 exit 1
27         fi
28 else
29         exit 0
30 fi
31
32
33 # See how we were called.
34 case "$1" in
35   start)
36         # Check if the service is already running?
37         if [ ! -f /var/lock/subsys/fakebo ]; then
38                 # show "Starting %s service." fakebo
39                 msg_starting fakebo
40                 daemon fakebo -b
41                 RETVAL=$?
42                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/fakebo
43         else
44                 # show "%s service is already running." fakebo
45                 msg_already_running fakebo
46                 exit 1
47         fi
48         ;;
49   stop)
50         # Stop daemons.
51         # show "Stopping %s service" fakebo
52         if [ -f /var/lock/subsys/fakebo ]; then
53                 msg_stopping fakebo
54                 killproc fakebo
55                 rm -f /var/lock/subsys/fakebo >/dev/null 2>&1
56         else
57                 # show "%s service is not running." fakebo
58                 msg_not_running fakebo
59                 exit 1
60         fi      
61         ;;
62   restart|reload)
63         $0 stop
64         $0 start
65         ;;
66   status)
67         status fakebo 
68         exit $?
69         ;;
70   *)
71         # show "Usage: %s {start|stop|restart|reload|status}"
72         msg_usage "$0 {start|stop|restart|reload|status}"
73         exit 1
74 esac
75
76 exit $RETVAL
This page took 0.324929 seconds and 4 git commands to generate.