1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-10 07:04:03 +00:00
freebsd-ports/www/zope213/files/zope213.in
Doug Barton 83eb2c3700 In the rc.d scripts, change assignments to rcvar to use the
literal name_enable wherever possible, and ${name}_enable
when it's not, to prepare for the demise of set_rcvar().

In cases where I had to hand-edit unusual instances also
modify formatting slightly to be more uniform (and in
some cases, correct). This includes adding some $FreeBSD$
tags, and most importantly moving rcvar= to right after
name= so it's clear that one is derived from the other.
2012-01-14 08:57:23 +00:00

86 lines
1.4 KiB
Bash

#!/bin/sh
#
# Startup script for Zope server.
#
# $FreeBSD$
#
# PROVIDE: zope213
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Define these zope213_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
#
# zope213_enable : bool
# Enable Zope ("YES") or not ("NO", the default).
#
# zope213_instances : list
# List of dirs with Zope's instances ("" by default).
#
. /etc/rc.subr
name="zope213"
rcvar=zope213_enable
load_rc_config $name
: ${zope213_enable:="NO"}
: ${zope213_instances:="%%ZOPEINSTANCEDIR%%"}
zope213_check_instances () {
cmd="$1"
shift
if [ -n "$*" ]; then
zope213_instances="$@"
elif [ -z "$zope213_instances" ]; then
err 1 "No value for zope213_instances, so nothing to do"
fi
}
zope213ctl () {
local instance
for instance in $zope213_instances; do
if [ -d ${instance} ]; then
echo -n " Zope instance ${instance} -> "
${instance}/bin/zopectl "$1"
fi
done
}
zope213_start () {
zope213_check_instances
echo -n 'Starting Zope 2.13:'
zope213ctl "start"
echo '.'
}
zope213_stop () {
zope213_check_instances
echo -n 'Stopping Zope 2.13:'
zope213ctl "stop"
echo '.'
}
zope213_restart () {
zope213_check_instances
echo -n 'Restarting Zope 2.13:'
zope213ctl "restart"
echo '.'
}
start_cmd="${name}_start"
stop_cmd="${name}_stop"
restart_cmd="${name}_restart"
cmd="$1"
shift
if [ -n "$*" ]; then
zope213_instances="$@"
fi
run_rc_command "${cmd}"