The first try was:
which happens to work when a disk is inserted in the drive.grep -qw iso9660 /proc/mounts || return 1;
echo $(mount | awk '/iso9660/{print $3}')
At my deliverables demo the disk was not present so bummer.
The second uses the Registry and works (in XP):
Brutal, eh?cdrom='';
for dr in D E F G H I J K L M N O P Q R S T U V W X Y Z
do
[ -e /proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/MountedDevices/%5CDosDevices%5C${dr}%3A ] || continue;
tr -d '\00' < /proc/registry/HKEY_LOCAL_MACHINE/SYSTEM/MountedDevices/%5CDosDevices%5C${dr}%3A | grep -qi cdrom || continue;
cdrom="$dr";
done
[ -z "$cdrom" ] && return 1;
echo /cygdrive/$(echo $cdrom | tr 'A-Z' 'a-z');
Anyways
is a great way to check whether a disk is in the unit (any unit).grep -qw iso9660 /proc/mounts || return 1;
-ulianov