]> git.pld-linux.org Git - packages/fakebo.git/blob - fakebo.init
- sort verify() flags, PreReq -> Requires
[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                 # 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 RETVAL=0
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         fi
47         ;;
48   stop)
49         # Stop daemons.
50         # show "Stopping %s service" fakebo
51         if [ -f /var/lock/subsys/fakebo ]; then
52                 msg_stopping fakebo
53                 killproc fakebo
54                 rm -f /var/lock/subsys/fakebo >/dev/null 2>&1
55         else
56                 # show "%s service is not running." fakebo
57                 msg_not_running fakebo
58         fi      
59         ;;
60   restart|force-reload)
61         $0 stop
62         $0 start
63         exit $?
64         ;;
65   status)
66         status fakebo 
67         exit $?
68         ;;
69   *)
70         # show "Usage: %s {start|stop|restart|force-reload|status}"
71         msg_usage "$0 {start|stop|restart|force-reload|status}"
72         exit 3
73 esac
74
75 exit $RETVAL
This page took 0.06024 seconds and 3 git commands to generate.