#!/bin/bash
#
# This script is needed to upgrade apache from web interface
# without giving a blank page
# HUP and USR1 signals does not restart a new version
#
# $Id: restarthttpd 3743 2009-10-25 22:36:58Z gespinasse $
#



case "$1" in
restart)
    # first wait some time for the web page to refresh, then stop and start
    /bin/sleep 10
    /usr/bin/killall -KILL httpd
    /usr/sbin/httpd
    ;;
*)
    [ -f /var/run/httpd.pid ] && /bin/kill -HUP `cat /var/run/httpd.pid`
    ;;
esac

exit 0
