Blob Blame History Raw
#!/bin/sh
#
# chkconfig: - 92 5
# description: bip is an IRC proxy server
#

BIP=/usr/bin/bip

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

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

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

RETVAL="0"

[ -x "$BIP" ] || exit 0

# See how we were called.
case "$1" in
  start)
	echo -n "Starting bip: "
	daemon --user=bip $BIP -f /etc/bip.conf
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/bip
	;;
  stop)
	echo -n "Stopping bip: "
	killproc bip
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bip
	;;
  status)
	status bip
	RETVAL=$?
	;;
  restart)
	$0 status >/dev/null && $0 stop
	$0 start
	RETVAL=$?
	;;
  condrestart)
	[ -f "/var/lock/subsys/bip" ] && $0 restart || :
	RETVAL=$?
	echo
	;;
  reload)
	echo -n "Reloading bip: "
	killproc bip -HUP
	RETVAL=$?
	echo
	;;
  *)
	echo "Usage: $0 {start|stop|status|restart|reload}"
	exit 1
esac

exit $RETVAL