#! /bin/bash
#
# lve-kmod      Bring up/down lve kernel interface
#
# chkconfig: 2345 10 90
# description: load and unload lve module
#

# Source function library.
. /etc/init.d/functions

if [ ! -f /etc/sysconfig/lve ]; then
    exit 0
fi

. /etc/sysconfig/lve

# Check that lve is enabled.
[ "${LVE_ENABLE}" = "no" ] && exit 0

# See how we were called.
case "$1" in
  start)
	echo $"loading LVE module"
	modprobe lve
        touch /var/lock/subsys/lve-kmod
        ;;
  stop)
	echo $"unloading LVE module"
	rmmod lve
        rm -f /var/lock/subsys/lve-kmod
        ;;
  status)
	;;
  restart|reload)
	$0 stop
	$0 start
	if [ -f /etc/init.d/lvectl ]; then
	    sleep 1
	    /etc/init.d/lvectl restart
	fi
	;;
  *)
        echo $"Usage: $0 {start|stop|restart|reload|status}"
        exit 1
esac

exit 0
