#!/bin/sh
#
# Start/stop/restart httpd daemon
#

httpd_start() {
if [ -x /usr/sbin/apachectl ]; then
    /usr/sbin/apachectl start
fi
}

httpd_stop() {
killall httpd 2> /dev/null
}

httpd_restart() {
/usr/sbin/apachectl stop
sleep 4
/usr/sbin/apachectl start
}

case "$1" in
'start')
    httpd_start
;;
'stop')
    httpd_stop
;;
'restart')
    httpd_restart
;;
*)
echo "usage $0 start|stop|restart"
esac
