#!/bin/sh

#======================================================================
#
# EMC PowerPath script to remove unused devices from PowerPath control
#
# Copyright (c) 2002, EMC Corporation. All Rights Reserved.
#
# $Revision: 1.2 $ $Date: 2004/05/06 18:13:10 $
#
#======================================================================

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

output='> /dev/null 2>&1'

usage()
{
	cat <<-EOF
	Usage: `basename $0` [-v|-h]
	        -v   verbose output
	        -h   display this usage

	EOF
}

       
while getopts :vh  c ; do
      case $c in
      v) output=
         ;;
      h) usage
         exit 0
         ;;
     \?) usage
         exit 1
         ;;
      esac
done


#----------------------------------------------------------------------
# Make sure the executables exist...
#
err=0


if [ ! -f /sbin/powermt ] ; then
   missing="/sbin/powermt"
   err=1
fi

if [ $err -gt 0 ] ; then
   echo "Error -- file(s) not found:"
   echo ${missing} | tr " " "\n"
   exit 1
fi


#----------------------------------------------------------------------
# run the command...
#
eval /sbin/powermt release ${output}

exit $?
