#!/bin/sh
# -----------------------------------------------------------------------------
# First coded by Luca - De Whiskey's - De Vitis <luca@debian.org>
# -----------------------------------------------------------------------------
# $Id: zope.init,v 1.6 2003/09/26 21:10:39 luca Exp $
#
#   Copyright (C) 2003 Luca - De Whiskey's - De Vitis <luca@debian.org>
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

PATH=/bin:/usr/bin:/sbin:/usr/sbin
ZOPECTL=/usr/sbin/zopectl

test -f $ZOPECTL || exit 0

. /etc/default/zope

if [ "$INSTANCES" = "NONE" -o "$INSTANCES" = "" ]; then
        echo "Zope instances have been disabled, edit /etc/default/zope to enable them."
        exit 0
elif [ "$INSTANCES" = ALL ]; then
        INSTANCES=''
fi

case "$1" in
    start|stop|restart|force-reload)
        $ZOPECTL $1 $INSTANCES
    ;;

    *)
        echo "Usage: /etc/init.d/zope {start|stop|restart|force-reload}"
        exit 1
    ;;
esac

exit 0
