#!/system/bin/sh
#!/system/bin/busybox sh

PWD_PATH="/mnt/internal_sd"
#ISO_PATH="/mnt/internal_sd/ISO"
ISO_PATH=`/system/bin/getprop sys.mount_iso.name`
MOUNT="iso_mount"
UMOUNT="iso_umount"
ISO_NAME="$ISO_PATH.iso"
#"/mnt/internal_sd/Erick.iso"

echo "begin to mount iso filesystem !!!"

function mount_iso()
{
    if [ ! -d $ISO_PATH ] ; then
        mkdir -p $ISO_PATH
    fi
    
    mount -r -o loop -t iso9660  $ISO_NAME  $ISO_PATH
}

function remount_iso()
{
    if [ -d $ISO_PATH ] ; then
        umount $ISO_PATH
        rm -r $ISO_PATH
    fi
}

case "$1" in
	"$MOUNT")
		echo "begin to mount !!!"
		mount_iso 
		;;
	"$UMOUNT")
		echo "cancel mount_dir !!!"
		remount_iso 
		;;
	*) 
		echo "unexpected argument."
	;;
esac

