83eb2c3700
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.
65 lines
1.1 KiB
Bash
65 lines
1.1 KiB
Bash
#!/bin/sh
|
|
#
|
|
# Startup script for Zeo server.
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: zeo211
|
|
# REQUIRE: DAEMON
|
|
# BEFORE: zope211
|
|
|
|
# Define these zeo211_* variables in one of these files:
|
|
# /etc/rc.conf
|
|
# /etc/rc.conf.local
|
|
# /etc/rc.conf.d/zeo211
|
|
#
|
|
# zeo211_enable : bool
|
|
# Enable Zeo ("YES") or not ("NO", the default).
|
|
#
|
|
# zeo211_instances : list
|
|
# List of dirs with Zeo's instances ("" by default).
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="zeo211"
|
|
rcvar=zeo211_enable
|
|
|
|
zeo211ctl () {
|
|
for instance in $zeo211_instances; do
|
|
if [ -d ${instance} ]; then
|
|
echo -n " Zeo instance ${instance} -> "
|
|
${instance}/bin/zeoctl "$1"
|
|
fi
|
|
done
|
|
}
|
|
|
|
zeo211_start () {
|
|
echo "Starting Zeo 2.11:"
|
|
zeo211ctl "start"
|
|
}
|
|
|
|
zeo211_stop () {
|
|
echo "Stopping Zeo 2.11:"
|
|
zeo211ctl "stop"
|
|
}
|
|
|
|
zeo211_restart () {
|
|
echo "Restarting Zeo 2.11:"
|
|
zeo211ctl "restart"
|
|
}
|
|
|
|
start_cmd="zeo211_start"
|
|
stop_cmd="zeo211_stop"
|
|
restart_cmd="zeo211_restart"
|
|
|
|
load_rc_config $name
|
|
|
|
: ${zeo211_enable="NO"}
|
|
|
|
cmd="$1"
|
|
[ $# -gt 0 ] && shift
|
|
[ -n "$*" ] && zeo211_instances="$*"
|
|
|
|
run_rc_command "${cmd}"
|