#! /bin/sh
#
# Copyright (C) 2003-2005 Kouichirou Eto
#     All rights reserved.
#     This is free software with ABSOLUTELY NO WARRANTY.
#
# You can redistribute it and/or modify it under the terms of 
# the GNU General Public License version 2.
#

start() {
	echo -n "Starting qwikWeb services: "
	/usr/local/qwik/bin/qwikweb-server
#	/usr/sbin/qwikweb-server
	echo
}

stop() {
	echo -n "Stopping qwikWeb services: "
#	kill `cat /var/run/quickml.pid`
	kill `cat /usr/local/qwik/log/qwikweb.pid`
	echo

#	pid = `cat /usr/local/qwik/log/qwikweb.pid`
#	pid = `cat /var/run/qwik/qwikweb.pid`
#	process = `ps ho%c -p $pid`
#	if [ $process = "qwikweb-server" ] ; then
#		kill $pid
#		echo 
#	else
#		echo "Stopping failed."
#	fi
}

case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  restart)
	stop
	sleep 1
	start
	;;
  *)
	echo "Usage: qwikweb-ctl {start|stop|restart}"
	exit 1
esac

exit 0
