# By			: Nguyen Tu.
# Website		: https://www.aioboot.com/en/grub2-file-manager/.
# Last modified	: 05.03.2018.
# Description	: File Manager - List files and directories, support for opening text files, ISO, PartIMG and partition images.
#				: Boot with Grub4dos.
#				: Boot with MemDisk.
#				: Boot with Loopback.
#				: Boot WinPE with wimboot and NTBOOT.
#				: Boot VHD with NTBOOT.
#				: Boot .efi, grldr, grub.exe... file.
				
set k="_"
echo ${scanpartmessage}
for dev in (*); do
	regexp -s device '\((.*)\)' $dev
	if ! searchindevice "$device" "on" "on"; then continue; fi
	probe -f -s fstype $device
	if [ -z "$fstype" ] -o [ "$fstype" == "procfs" ]; then continue; fi
	probe -s vollabel -l $device
	probe -s voluuid -u $device
	if [ -z "$vollabel" ]; then set vollabel="${noname}"; fi
	GetHotkey
	submenu "[${k}] ${device} - ${vollabel} - ${fstype} - ${voluuid}" $device --hotkey="${k}" {
		FileManager "(${2})"
	}
	unset vollabel
	unset voluuid
	unset fstype
done
source ${prefix}/ReturnMain.cfg