#!/bin/bash
# 
# List currently known ASM disks.
#


# Force LC_ALL=C
export LC_ALL=C
 
USAGE="[-l <manager>] [-v]"

exec 3>/dev/null

help=
verbose=
version=
usage=
while case "$#" in 0) break ;; esac
do
    case "$1" in
    -l|--manager)
        case "$#" in 1) usage=t; break ;; esac
        shift
        ORACLE_ASMMANAGER="$1"
        ;;
    -v|--verbose)
        verbose=t
        exec 3>&2
        ;;
    -V|--version)
        version=t
        ;;
    -h|--help)
        help=t
        ;;
    *)
        usage=t
        ;;
    esac
    shift
done

# Load configuration
. oracleasm-Xshlib

if [ "$help" = "t" -o "$usage" = "t" ]
then
    usage
fi

if [ "$version" = "t" ]
then
    version
fi

disk_path="`asm_disk_path "${ORACLE_ASMMANAGER}"`"
if [ -d "$disk_path" ]
then
    ls -1 "${disk_path}" 2>&3
fi

