LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File bip.init of Package bip (Project home:barendartchuk)

#!/bin/sh
### BEGIN INIT INFO
# Provides:          bip
# Required-Start:    $network $syslog $remote_fs
# Required-Stop:     $network $syslog $remote_fs
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# X-Interactive:     true
# Short-Description: The bip IRC proxy
### END INIT INFO

BIP=/usr/bin/bip

# required by bip:
export HOME=/var/lib/bip

. /etc/rc.status

# Reset status of this service
rc_reset

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

[ -d /var/run/bip ] || install -d -o bip -g bip /var/run/bip

# See how we were called.
case "$1" in
  start)
	echo -n "Starting bip "
	/sbin/startproc -u bip $BIP -f /etc/bip.conf
	
	rc_status -v
	;;
  stop)
	echo -n "Shutting down bip "

	/sbin/killproc -TERM $BIP

	rc_status -v
	;;
  status)
	echo -n "Checking for service bip "
	/sbin/checkproc $BIP

	rc_status -v
	;;
  restart)
	$0 stop
	$0 start

	rc_status
	;;
  condrestart)
	## Do a restart only if the service was active before.
	## Note: try-restart is now part of LSB (as of 1.9).
	## RH has a similar command named condrestart.
	if test "$1" = "condrestart"; then
		echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
	fi
	$0 status
	if test $? = 0; then
		# do a warmstart in this case, keeping the state
		$0 restart
	else
		rc_reset	# Not running is not a failure.
	fi
	# Remember status and be quiet
	rc_status
	;;
  reload)
	rc_failed 3
	rc_status -v
	;;
  *)
	echo "Usage: $0 {start|stop|status|restart|reload}"
	exit 1
esac

exit $RETVAL