Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 309b6058a24e449bf5a79ce75e1cc182 > files > 23

opensips-1.6.4-6.fc15.i686.rpm

#!/bin/bash
#
# Startup script for OpenSIPS
#
# chkconfig: - 85 15
# description: OpenSIPS is a fast SIP Server.
#
# processname: opensips
# pidfile: /var/run/opensips.pid
# config: /etc/opensips/opensips.cfg
#
### BEGIN INIT INFO
# Provides: opensips
# Required-Start: $local_fs $network $named
# Should-Start: mysqld postgresql
# Short-Description: start, stop OpenSIPS
# Description: OpenSIPS is a very fast and flexible SIP (RFC3261) server.
### END INIT INFO

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

oser=/usr/sbin/opensips
prog=opensips
RETVAL=0

[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog

start() {
	echo -n $"Starting $prog: "
	# there is something at end of this output which is needed to
	# report proper [ OK ] status in Fedora scripts
	daemon $oser $OPTIONS 2>/dev/null | tail -1
	RETVAL=$?
	echo
	[ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
}

stop() {
	echo -n $"Stopping $prog: "
	killproc $oser
	RETVAL=$?
	echo
	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog /var/run/$prog.pid
}

# See how we were called.
case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	status)
		status $oser
		RETVAL=$?
		;;
	restart|reload)
		stop
		start
		;;
	condrestart)
		if [ -f /var/run/opensips.pid ] ; then
			stop
			start
		fi
		;;
	*)
		echo $"Usage: $prog {start|stop|reload|restart|condrestart|status|help}"
		exit 1
esac

exit $RETVAL