#! /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/zopectl.py" ]; then
  ZDCTL="$SOFTWARE_HOME/Zope2/Startup/zopectl.py"
else
  ZDCTL="$SOFTWARE_HOME/Zope/Startup/zopectl.py"
fi

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