#!/usr/bin/bash
#
# Copyright (c) 2006, 2025, Oracle and/or its affiliates.
#
# List currently known ASM disks.
#


# Force LC_ALL=C
export LC_ALL=C

USAGE="[-v]"

exec 3>/dev/null

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

# Load configuration
. oracleasm-Xshlib
check_oracleasm_config

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

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

if [ "$ORACLEASM_DRIVER_SUPPORTED" = "false" ]
then
    asm_disk_path
else
    disk_path="$(asm_disk_path)"
    if [ -d "$disk_path" ]
    then
        ls -1 "${disk_path}" 2>&3
    fi
fi

