#!/bin/sh # # Startup script for Zope server. # # $FreeBSD$ # # PROVIDE: zope210 # REQUIRE: DAEMON # Define these zope210_* variables in one of these files: # /etc/rc.conf # /etc/rc.conf.local # /etc/rc.conf.d/zope210 # # zope210_enable : bool # Enable Zope ("YES") or not ("NO", the default). # # zope210_instances : list # List of dirs with Zope's instances ("" by default). # . %%RC_SUBR%% name="zope210" rcvar=`set_rcvar` zope210ctl () { for instance in $zope210_instances; do if [ -d ${instance} ]; then echo -n " Zope instance ${instance} -> " ${instance}/bin/zopectl "$1" fi done } zope210_start () { echo "Starting Zope 2.10:" zope210ctl "start" } zope210_stop () { echo "Stopping Zope 2.10:" zope210ctl "stop" } zope210_restart () { echo "Restarting Zope 2.10:" zope210ctl "restart" } start_cmd="zope210_start" stop_cmd="zope210_stop" restart_cmd="zope210_restart" load_rc_config $name : ${zope210_enable="NO"} : ${zope210_instances=""} cmd="$1" [ $# -gt 0 ] && shift [ -n "$*" ] && zope210_instances="$*" run_rc_command "${cmd}"