#!/bin/sh

#
#  Figure out the installation path
#
base=`basename $0`
basedir=`dirname $0`
dir=`(cd $basedir; cd ..; pwd)`
if [ ! -f "$dir/bin/$base" ]; then
    echo "Can't determine installation directory - exiting."
    exit 1
fi

#
#  Stop the server
#
pidfile=$dir/logs/httpd.pid
if [ -f $pidfile ]; then
	echo "stoping Lyris web server...."
	pid=`cat $pidfile`
	kill -15 $pid
	sleep 2
	pro=`ps -p $pid | grep -i apache`
	if [ ! -z "$pro" ]; then
		kill -9 $pid
	fi
else
	echo "no PID file.  Assuming Lyris web server is already stopped."
fi

