#! /bin/sh
#
# ###################################################################
# Copyright (c) 2000, EMC Corporation. All Rights Reserved.
#
# Most Recent Author: Ajith Balakrishnan
# Previous Authors:
#
# Contents:
# This scripts configures iSCSI devices for EMC PowerPath. 
# ###################################################################
#
. /etc/rc.status
rc_reset
# CONFIG_DELAY=0

case "$1" in
    start)
        if [ -f /etc/init.d/iscsi ]; then
            # echo "Delaying PowerPath device configuartion for $CONFIG_DELAY seconds..."
            # sleep $CONFIG_DELAY
            echo "Configuring iSCSI devices for PowerPath...."
            /sbin/powermt config > /dev/null 2>&1
            /sbin/powermt load > /dev/null 2>&1
            /etc/opt/emcpower/emcpmgr map > /dev/null 2>&1
            iscsi-mountall
            rc_status
        fi
        /sbin/powermt save > /dev/null 2>&1
        rc_status -v
        ;;
    stop)
        rc_status -v
        ;;
    *)
        echo "Usage: $0 {start|stop}"
        exit 1
esac
rc_exit

