#! /bin/sh

PYTHON="<<PYTHON>>"
ZOPE_HOME="<<ZOPE_HOME>>"
INSTANCE_HOME="<<INSTANCE_HOME>>"
CONFIG_FILE="<<INSTANCE_HOME>>/etc/zope.conf"
SOFTWARE_HOME="<<SOFTWARE_HOME>>"
PYTHONPATH="$SOFTWARE_HOME"
export PYTHONPATH INSTANCE_HOME SOFTWARE_HOME

export erp5_load_data_fs="1"

if [ -f "$SOFTWARE_HOME/Zope2/Startup/run.py" ]; then
  ZOPE_RUN="$SOFTWARE_HOME/Zope2/Startup/run.py"
else
  ZOPE_RUN="$SOFTWARE_HOME/Zope/Startup/run.py"
fi

exec "$PYTHON" "$ZOPE_RUN" -C "$CONFIG_FILE" "$@"
