#!/bin/sh
#
# Run control script for Interchange
# http://www.icdevgroup.org/
#
# chkconfig: 345 96 4
# description: Interchange is a web application server focused on ecommerce
# processname: interchange
# pidfile: /var/run/interchange/interchange.pid
# config: /etc/interchange.cfg
# config: /var/lib/interchange/*/catalog.cfg

# Source function library.
. /etc/rc.d/init.d/functions

# See how we were called.
case "$1" in
	start)
		echo -n "Starting Interchange: "
		daemon interchange -q
		echo
		touch /var/lock/subsys/interchange
		;;
	stop)
		echo -n "Shutting down Interchange: "
		killproc interchange
		echo
		rm -f /var/lock/subsys/interchange /var/run/interchange/interchange.pid
		;;
	status)
		status interchange
		;;
	restart|reload)
		$0 stop
		$0 start
		;;
	*)
		echo "Usage: $0 {start|stop|restart|reload|status}"
		exit 1
esac

exit 0
