#!/bin/sh
#
# fakebo	This shell script takes care of starting and stopping
#		fakebo (trojan server fake daemon).
#
# chkconfig: 345 92 34
# description: FakeBO fakes trojan server responses (Back Orifice, \
# NetBus, etc.) and logs every attempt to a logfile or stdout.

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# Check that fakebo.conf exists.
[ -f /etc/fakebo.conf ] || exit 0

# See how we were called.
case "$1" in
  start)
        # Start daemons.
	echo -n "Starting FakeBO: "
	daemon fakebo -b
	touch /var/lock/subsys/fakebo
	;;
  stop)
        # Stop daemons.
	echo -n "Shutting down FakeBO: "
	killproc fakebo
	echo
	rm -f /var/lock/subsys/fakebo
	;;
  status)
	status fakebo
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: fakebo {start|stop|restart|status}"
	exit 1
esac

exit 0
