#!/bin/sh
# chkconfig: 2345 85 15
### BEGIN INIT INFO
# Provides: MSUWebService
# Required-Start: $network $syslog $MarvellRaidEventAgent
# Required-Stop: $network $syslog
# Default-Start: 1 2 3 5
# Default-Stop: 0 6
# Description: Marvell Storage Utility Web Service
### END INIT INFO

RETVAL=0

LD_LIBRARY_PATH=/opt/marvell/storage/apache2/lib64:/opt/marvell/storage/expat/lib64:/opt/marvell/storage/libxml2/lib64:/opt/marvell/storage/openssl/lib64:/opt/marvell/storage/php/lib64

export LD_LIBRARY_PATH

start()
{
	service iptables stop > /dev/null 2>&1 
	service ip6tables stop > /dev/null 2>&1
        echo -n "Starting Marvell Storage Utility Web Service."
	echo
        /opt/marvell/storage/apache2/bin/apachectl start
        RETVAL=$?
}

stop()
{
	service iptables start > /dev/null 2>&1
	service ip6tables start > /dev/null 2>&1
        echo -n "Stoping Marvell Storage Utility Web Service."
	echo
        /opt/marvell/storage/apache2/bin/apachectl stop
        RETVAL=$?
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    start
    ;;
esac

sleep 2

exit $RETVAL
