#!/bin/bash
#
# ovirt-awake - Notifies any management server that the node is starting.
#
# Copyright (C) 2008-2010 Red Hat, Inc.
# Written by Darryl L. Pierce <dpierce@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA  02110-1301, USA.  A copy of the GNU General Public License is
# also available at http://www.gnu.org/copyleft/gpl.html.
#
### BEGIN INIT INFO
# Provides: ovirt-awake
# Required-Start: ovirt-early
# Default-Start: 2 3 4 5
# Description: Managed node service to alert management servers.
### END INIT INFO

# Source functions library
. /usr/libexec/ovirt-init-functions.sh

prog=ovirt-awake


case "$1" in
    start)
        echo -n "Starting ovirt-awake: "
        start_ovirt_awake
        test $? == 0 && success || failure
        echo
        ;;

    stop)
        echo -n "Stopping ovirt-awake: "
        stop_ovirt_awake
        test $? == 0 && success || failure
        echo
        ;;

    reload)
        reload_ovirt_awake
        ;;

    *)
        echo "Usage: $0 start"
        RETVAL=2
        ;;
esac

exit $RETVAL
