#!/bin/sh
#
# ###################################################################
# Copyright (c) 2005-2014, EMC Corporation. All Rights Reserved.
#
# /etc/init.d/PowerMigRecoverAll
# This file is a part of EMC PowerPath.
#
# chkconfig: 35 99 73
# description: Runs PowerPath Migration Enabler recovery during shutdown
#
# ###################################################################
#
### BEGIN INIT INFO
# Provides:          PowerMigRecoverAll
# Required-Start:
# Required-Stop:
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Description:       PowerMigRecoverAll -- Runs PowerPath Migration Enabler \
#                    recovery during shutdown
### END INIT INFO


PATH=/usr/bin/:/bin:/sbin:/usr/sbin

case "$1" in
    start)
        if [ -f /etc/redhat-release ]; then
            cat /etc/redhat-release | grep "Red Hat"  > /dev/null
            if [ $? -eq 0 ]; then
                touch /var/lock/subsys/PowerMigRecoverAll
            fi
        fi
        ;;

    stop)
        /sbin/powermig recover -all -no > /dev/null 2>&1
        ;;
    *)
        ;;
esac

