Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > contrib-release > by-pkgid > c97dc9818c994cda61d707ef78cf9a45 > files > 5

greensql-fw-1.1.0-1mdv2010.0.x86_64.rpm

#!/bin/bash
#
# greensql-fw	This shell script takes care of starting and stopping greensql.
#
# chkconfig: - 79 11
# description: greensql-fw is a Open Source Database Firewall.
# probe: false
# processname: greensql-fw
# pidfile: /var/run/greensql.pid
# config: /etc/greensql/greensql.conf
# config: /etc/sysconfig/greensql-fw

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

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

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

[ -f /etc/greensql/greensql.conf ] || exit 0

[ -f /usr/sbin/greensql-fw ] || exit 0

[ -f /etc/sysconfig/greensql-fw ] && . /etc/sysconfig/greensql-fw

RETVAL=0

# See how we were called.
case "$1" in
  start)
	if [ -n "`/sbin/pidof greensql-fw`" ]; then
            gprintf "greensql-fw: already running"
	    RETVAL=$?
	    echo
	    exit $RETVAL
        fi
	gprintf "Starting greensql-fw: "
	greensql-fw ${GREENSQL_OPTIONS:-"-p /etc/greensql/"} > /dev/null 2>&1 &
	RETVAL=$?
	[ $RETVAL -eq 0 ] && success || failure
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/greensql-fw
	;;
  stop)
	gprintf "Stopping greensql-fw: "
	killproc greensql-fw
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/greensql-fw
	;;
  status)
	status greensql-fw
	RETVAL=$?
	;;
  restart|reload)
	$0 stop
	$0 start
	RETVAL=$?
	;;
condrestart)
	[ -f /var/lock/subsys/greensql-fw ] && restart || :
	;;
  *)
	gprintf "Usage: greensql-fw {start|stop|status|restart|condrestart|reload}\n"
	exit 1
esac

exit $RETVAL