1d6b4b3f91
s#. %%RC_SUBR%%#. /etc/rc.subr#
64 lines
1.1 KiB
Bash
64 lines
1.1 KiB
Bash
#!/bin/sh
|
|
#
|
|
# Startup script for Zope server.
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: zope211
|
|
# REQUIRE: DAEMON
|
|
|
|
# Define these zope211_* variables in one of these files:
|
|
# /etc/rc.conf
|
|
# /etc/rc.conf.local
|
|
# /etc/rc.conf.d/zope211
|
|
#
|
|
# zope211_enable : bool
|
|
# Enable Zope ("YES") or not ("NO", the default).
|
|
#
|
|
# zope211_instances : list
|
|
# List of dirs with Zope's instances ("" by default).
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="zope211"
|
|
rcvar=`set_rcvar`
|
|
|
|
zope211ctl () {
|
|
for instance in $zope211_instances; do
|
|
if [ -d ${instance} ]; then
|
|
echo -n " Zope instance ${instance} -> "
|
|
${instance}/bin/zopectl "$1"
|
|
fi
|
|
done
|
|
}
|
|
|
|
zope211_start () {
|
|
echo "Starting Zope 2.11:"
|
|
zope211ctl "start"
|
|
}
|
|
|
|
zope211_stop () {
|
|
echo "Stopping Zope 2.11:"
|
|
zope211ctl "stop"
|
|
}
|
|
|
|
zope211_restart () {
|
|
echo "Restarting Zope 2.11:"
|
|
zope211ctl "restart"
|
|
}
|
|
|
|
start_cmd="zope211_start"
|
|
stop_cmd="zope211_stop"
|
|
restart_cmd="zope211_restart"
|
|
|
|
load_rc_config $name
|
|
|
|
: ${zope211_enable="NO"}
|
|
: ${zope211_instances=""}
|
|
|
|
cmd="$1"
|
|
[ $# -gt 0 ] && shift
|
|
[ -n "$*" ] && zope211_instances="$*"
|
|
|
|
run_rc_command "${cmd}"
|