]> git.pld-linux.org Git - packages/fakebo.git/blame - fakebo.init
- use %service
[packages/fakebo.git] / fakebo.init
CommitLineData
c8deca80 1#!/bin/sh
2#
3# fakebo This shell script takes care of starting and stopping
4# fakebo (trojan server fake daemon).
5#
4919fa83 6# chkconfig: 345 95 06
c8deca80 7#
4919fa83 8# description: FakeBO fakes trojan server responses (Back Orifice, \
c8deca80 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.
5c6f6e36 22if is_yes "${NETWORKING}"; then
57728c8a 23 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
5c6f6e36 24 msg_network_down fakebo
25 exit 1
26 fi
27else
28 exit 0
c8deca80 29fi
30
670f670b 31RETVAL=0
c8deca80 32# See how we were called.
33case "$1" in
34 start)
35 # Check if the service is already running?
36 if [ ! -f /var/lock/subsys/fakebo ]; then
c8deca80 37 msg_starting fakebo
38 daemon fakebo -b
39 RETVAL=$?
40 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/fakebo
41 else
5c6f6e36 42 msg_already_running fakebo
c8deca80 43 fi
5c6f6e36 44 ;;
c8deca80 45 stop)
5c6f6e36 46 # Stop daemons.
c8deca80 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
5c6f6e36 52 msg_not_running fakebo
2cb572ce 53 fi
5c6f6e36 54 ;;
670f670b 55 restart|force-reload)
5c6f6e36 56 $0 stop
c8deca80 57 $0 start
670f670b 58 exit $?
5c6f6e36 59 ;;
c8deca80 60 status)
2cb572ce 61 status fakebo
c8deca80 62 exit $?
5c6f6e36 63 ;;
c8deca80 64 *)
670f670b 65 msg_usage "$0 {start|stop|restart|force-reload|status}"
66 exit 3
c8deca80 67esac
68
69exit $RETVAL
This page took 0.199961 seconds and 4 git commands to generate.