summaryrefslogtreecommitdiff
path: root/www/zope29/files/zeo29.sh
blob: 851dfdd928dc1ea855dee7d555111ce21361b83f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
#
# Startup script for Zeo server.
#
# $NetBSD: zeo29.sh,v 1.1 2006/08/17 11:57:25 darcy Exp $
#

# PROVIDE: zeo29
# REQUIRE: DAEMON
# BEFORE: zope29
#
# You will need to set some variables in /etc/rc.conf to start one
# or more instances.
#
# zeo29_enable : bool
#   Enable Zeo ("YES") or not ("NO", the default).
#
# zeo29_instances : list
#   List of dirs with Zeo's instances ("" by default).
#

if [ -f /etc/rc.subr ]
then
	. /etc/rc.subr
fi

name="zeo29"
rcvar=`set_rcvar`

zeo29ctl () {
    for instance in $zeo29_instances; do
	if [ -d ${instance} ]; then
	    echo -n "  Zeo instance ${instance} -> "
	    ${instance}/bin/zeoctl "$1"
	fi
    done
}

zeo29_start () {
    echo "Starting Zeo 2.9:"
    zeo29ctl "start"
}

zeo29_stop () {
    echo "Stopping Zeo 2.9:"
    zeo29ctl "stop"
}

zeo29_restart () {
    echo "Restarting Zeo 2.9:"
    zeo29ctl "restart"
}

  start_cmd="zeo29_start"
   stop_cmd="zeo29_stop"
restart_cmd="zeo29_restart"

load_rc_config $name

: ${zeo29_enable="NO"}
: ${zeo29_instances=""}

cmd="$1"
[ $# -gt 0 ] && shift
[ -n  "$*" ] && zeo29_instances="$*"

run_rc_command "${cmd}"