#!/bin/bash
#
# evm           This start and stops EVM
#
# chkconfig: 2345 18 82
# description: The EVM daemon
# config: /etc/evm*.conf

. /etc/init.d/functions

RETVAL=$?

start() {
	if [ -r /var/run/evmd.pid ]
	then
	    echo "Starting EVM: evmd already running"
	else
	    # Create /etc/rc.config file to store HOSTNAME.
	    echo "HOSTNAME=\"`hostname -f`\"" > /etc/rc.config
            action $"Starting EVM: " /usr/sbin/evmstart
	fi
}

stop() {
        action $"Stopping EVM: " /usr/sbin/evmstop
}

restart() {
        stop;
        start;
}

case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        restart|reload)
                restart
                ;;
        status)
                status evmd
                ;;
        *)
                echo $"Usage: $0 {start|stop|restart|reload|status}"
                exit 1
esac

exit $RETVAL


