freebsd-ports/www/zope28/files/zeo28.sh.in
Pav Lucistnik 5eade7a03d - Update to 2.8.5
PR:		ports/91365
Submitted by:	Denis Shaposhnikov <dsh@vlink.ru> (maintainer)
2006-01-05 23:39:09 +00:00

66 lines
1.1 KiB
Bash

#!/bin/sh
#
# Startup script for Zeo server.
#
# $FreeBSD$
#
# PROVIDE: zeo28
# REQUIRE: DAEMON
# BEFORE: zope28
# Define these zeo28_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/zeo28
#
# zeo28_enable : bool
# Enable Zeo ("YES") or not ("NO", the default).
#
# zeo28_instances : list
# List of dirs with Zeo's instances ("" by default).
#
. %%RC_SUBR%%
name="zeo28"
rcvar=`set_rcvar`
zeo28ctl () {
for instance in $zeo28_instances; do
if [ -d ${instance} ]; then
echo -n " Zeo instance ${instance} -> "
${instance}/bin/zeoctl "$1"
fi
done
}
zeo28_start () {
echo "Starting Zeo 2.8:"
zeo28ctl "start"
}
zeo28_stop () {
echo "Stopping Zeo 2.8:"
zeo28ctl "stop"
}
zeo28_restart () {
echo "Restarting Zeo 2.8:"
zeo28ctl "restart"
}
start_cmd="zeo28_start"
stop_cmd="zeo28_stop"
restart_cmd="zeo28_restart"
load_rc_config $name
: ${zeo28_enable="NO"}
: ${zeo28_instances=""}
cmd="$1"
[ $# -gt 0 ] && shift
[ -n "$*" ] && zeo28_instances="$*"
run_rc_command "${cmd}"