Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 0e5bdb0625988221f7c8285d8bfb8eac > files > 3

pound-1.8-1mdk.src.rpm

#!/bin/bash
#
# pound	        This shell script starts and stops pound
#
# chkconfig: 345 85 15
# description:	The Pound program is a reverse proxy, load balancer and HTTPS
# front-end for Web server(s)
# probe: false

. /etc/rc.d/init.d/functions

# Get network config
. /etc/sysconfig/network

# Get service config
[ -f /etc/sysconfig/pound ] && . /etc/sysconfig/pound

# Check that networking is up.
if is_yes "${NETWORKING}"; then
        if [ ! -f /var/lock/subsys/network ]; then
                # nls "ERROR: Networking is down. %s can't be run." pound
                msg_network_down pound
                exit 1
        fi
else
        exit 0
fi

# See how we were called.
case "$1" in
  start)
	# Check if the service is already running?
        if [ ! -f /var/lock/subsys/'pound' ]; then
		msg_starting pound
        	daemon pound -f /etc/pound/pound.conf
		RETVAL=$?
    		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pound
	else
        	msg_Already_Running pound
	        exit 1
	fi
	;;
  stop)
        # Stop daemons.
	if [ -f /var/lock/subsys/'pound' ]; then
                msg_stopping pound
                killproc pound
                rm -f /var/lock/subsys/'pound' > /dev/null 2>&1
        else
		msg_Not_Running pound
	        exit 1
	fi
	;;
  status)
	status pound
	RETVAL=$?
	exit $RETVAL
	;;
  restart|reload)
	$0 stop
	$0 start
	;;
  *)
	msg_Usage "$0 {start|stop|restart|status}"
	exit 1
	;;
esac

exit $RETVAL