blob: ec317a2e2212ba618a60c01168a30be556c5e6c0 (
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
|
#!/bin/sh
ID='$NetBSD: zope25-create,v 1.2 2003/08/11 13:15:42 drochner Exp $'
PYTHONBIN=@@PYTHONBIN@@
ZOPE_HOME=@@ZOPE_HOME@@
INSTANCE_HOME=/var/zope
if [ $# -gt 0 ]; then
INSTANCE_HOME=$1
fi
STARTSCRIPT=${INSTANCE_HOME}/zope-start
echo "Creating Zope instance in ${INSTANCE_HOME}"
mkdir -p ${INSTANCE_HOME}
mkdir -p ${INSTANCE_HOME}/var
if [ ! -d ${INSTANCE_HOME} -o ! -w ${INSTANCE_HOME} ]; then
echo "Fatal error: cannot access instance home directory"
exit 1
fi
echo "Initial user authentication"
(cd ${INSTANCE_HOME} && ${PYTHONBIN} ${ZOPE_HOME}/zpasswd.py inituser)
SCRIPT_FIX=""
for i in PYTHONBIN ZOPE_HOME INSTANCE_HOME;do
eval v=\${$i}
SCRIPT_FIX="${SCRIPT_FIX} -e s|@$i@|$v|"
done
sed ${SCRIPT_FIX} >${STARTSCRIPT} <<SCRIPT_END
#!/bin/sh
# created automatically by ${ID}
PYTHONBIN=@PYTHONBIN@
ZOPE_HOME=@ZOPE_HOME@
INSTANCE_HOME=@INSTANCE_HOME@
export INSTANCE_HOME
exec \${PYTHONBIN} \${ZOPE_HOME}/z2.py \$*
SCRIPT_END
chmod +x ${STARTSCRIPT}
echo "To start ZServer for this instance, run ${STARTSCRIPT}"
|