#!/bin/sh
#
# No copyright is claimed for this file.
#
# See http://www.archiveopteryx.org/ for more about Archiveopteryx.
#
# Try to keep various init.d managers happy:
#
# chkconfig: 35 99 01
# description: Start Archiveopteryx <http://www.archiveopteryx.org>
#
### BEGIN INIT INFO
# Provides:       archiveopteryx
# Required-Start: postgresql sendmail
# Required-Stop:
# Default-Start:  3 5
# Default-Stop:
# Description:    Start Archiveopteryx <http://www.archiveopteryx.org>
### END INIT INFO

# Note: BINDIR is evaluated at build time.
cd /usr/bin

case "$1" in
    start)
        echo -n "Starting Archiveopteryx: "
        ./aox start
        echo "done."
        ;;
    stop)
        echo -n "Stopping Archiveopteryx: "
        ./aox stop
        echo "done."
        ;;
    restart)
        echo -n "Restarting Archiveopteryx: "
        ./aox restart
        echo "done."
        ;;
    status)
        ./aox show status
        ;;
    *)
        echo "Usage: archiveopteryx {start|stop|restart|status}"
        exit 1
        ;;
esac

exit 0
