summaryrefslogtreecommitdiff
path: root/www/zope210/files/zope210.in
blob: daba77525c7e058662d73d6f51fdf131fd7fef8b (plain) (blame)
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
#!/bin/sh
#
# Startup script for Zope server.
#
# $FreeBSD$
#

# PROVIDE: zope210
# REQUIRE: DAEMON

# Define these zope210_* variables in one of these files:
#       /etc/rc.conf
#       /etc/rc.conf.local
#       /etc/rc.conf.d/zope210
#
# zope210_enable : bool
#   Enable Zope ("YES") or not ("NO", the default).
#
# zope210_instances : list
#   List of dirs with Zope's instances ("" by default).
#

. %%RC_SUBR%%

name="zope210"
rcvar=`set_rcvar`

zope210ctl () {
    for instance in $zope210_instances; do
	if [ -d ${instance} ]; then
	    echo -n "  Zope instance ${instance} -> "
	    ${instance}/bin/zopectl "$1"
	fi
    done
}

zope210_start () {
    echo "Starting Zope 2.10:"
    zope210ctl "start"
}

zope210_stop () {
    echo "Stopping Zope 2.10:"
    zope210ctl "stop"
}

zope210_restart () {
    echo "Restarting Zope 2.10:"
    zope210ctl "restart"
}

  start_cmd="zope210_start"
   stop_cmd="zope210_stop"
restart_cmd="zope210_restart"

load_rc_config $name

: ${zope210_enable="NO"}
: ${zope210_instances=""}

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

run_rc_command "${cmd}"