I recently found a nautilus shell script on an older post to the forum that could mount .iso files, but it couldn't handle spaces in filenames or mount more than one file at once. After some struggle I've come up with these scripts which handle multiple concurrent mounts and filenames with spaces. You'll want to save these under ~/.gnome2/nautilus-scripts/ and make them executable:
Mount:
Code:
#!/bin/bash
#
# nautilus-mount-iso
gksudo -u root -k /bin/echo "got r00t?"
sudo mkdir /media/"$*"
if sudo mount -o loop -t iso9660 "$*" /media/"$*"
then
if zenity --question --title "ISO Mounter" --text "$* Successfully Mounted.
Open Volume?"
then
nautilus /media/"$*" --no-desktop
fi
exit 0
else
sudo rmdir /media/"$*"
zenity --error --title "ISO Mounter" --text "Cannot mount $*!"
exit 1
fi
Unmount:
Code:
#!/bin/bash
#
for I in "$*"
do
foo=`gksudo -u root -k -m "enter your password for root terminal
access" /bin/echo "got r00t?"`
sudo umount "$I" && zenity --info --text "Successfully unmounted /media/$I/" && sudo rmdir "/media/$I/"
done
done
exit0
To use either one just right click on the .iso file and use scripts -> mount. Hope someone finds this useful. Does anyone know if there's a way to make nautilus just unmount by right clicking on the volume icon on the desktop and selecting unmount volume?
Bookmarks