Appendix A: Example Startup Script

by Chad Whitacre last modified Dec 30, 2008 03:04 PM
/Library/StartupItems/Zope/Zope
#!/bin/sh

##
# Zope Web Application Server
##

. /etc/rc.common

StartService ()
{
    if [ "${ZOPESERVER:=-NO-}" = "-YES-" ]; then
        ConsoleMessage "Starting Zope"
        /usr/local/zope/instance/bin/zopectl start
    fi
}

StopService ()
{
    ConsoleMessage "Stopping Zope"
    /usr/local/zope/instance/bin/zopectl stop
}

RestartService ()
{
    if [ "${ZOPESERVER:=-NO-}" = "-YES-" ]; then
        ConsoleMessage "Restarting Zope"
        /usr/local/zope/instance/bin/zopectl restart
    fi
}

RunService "$1"