]> git.pld-linux.org Git - packages/fakebo.git/blob - fakebo.init
8044c5f8d9769eff268235fe2fa8e1be fakebo.init
[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  99 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_no "${NETWORKING}"; then
23         # nls "ERROR: Networking is down. %s can't be run." fakebo
24         msg_Network_Down fakebo
25         exit 1
26 fi
27
28
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/fakebo ]; then
34                 # show "Starting %s service." fakebo
35                 msg_starting fakebo
36                 daemon fakebo -b
37                 RETVAL=$?
38                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/fakebo
39         else
40                 # show "%s service is already running." fakebo
41                 msg_Already_Running fakebo
42                 exit 1
43         fi
44         ;;
45   stop)
46         # Stop daemons.
47         # show "Stopping %s service" fakebo
48         if [ -f /var/lock/subsys/fakebo ]; then
49                 msg_stopping fakebo
50                 killproc fakebo
51                 rm -f /var/lock/subsys/fakebo >/dev/null 2>&1
52         else
53                 # show "%s service is not running." fakebo
54                 msg_Not_Running fakebo
55                 exit 1
56         fi      
57         ;;
58   restart)
59         $0 stop
60         $0 start
61         ;;
62   status)
63         status fakebo 
64         exit $?
65         ;;
66   *)
67         # show "Usage: %s {start|stop|status|restart|reload|force-reload}" $0
68         msg_Usage "$0 {start|stop|status|restart}"
69         exit 1
70 esac
71
72 exit $RETVAL
This page took 0.113723 seconds and 4 git commands to generate.