sonny
May 12th, 2005, 08:00 PM
Well I was looking for some scripts to mount and unmount iso images but I found none, well actually there's a thread here (http://www.ubuntuforums.org/showthread.php?t=30635&highlight=scripts+iso) about doing so, but the script is missing some basic parts that I just added, this thread was my inspiration on doing the scripts below, if someone has done it allready , well one more wouldn't hurt anyone. One thing to notice, this scripst are for nautilus, KDE users don't need this, there's plenty of konqueror's plugins that manage iso files.
Ok this code is now fixed with all the observations made from everyone, and correcting some mistakes I've made.
Script for Mounting an Iso
First we make the folder where the files are going to be mounted, open a terminal and type:
~$ sudo mkdir /media/iso (I prefer this becuse then I just go to the system and the iso folder will be next to the cdrom and/or floppy like an other dev)
In a terminal do:
~$ gedit ~/.gnome2/nautilus-scripts/Mount\ Iso
When gedit shows up write this code:
#!/bin/bash
for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
gnome-terminal -x sudo mount -o loop -t iso9660 "$1" /media/iso
done
Finally you have to make the file executable, to do so type in a terminal:
~$ chmod +x ~/.gnome2/nautilus-scripts/Mount\ Iso
Now you can right click on an iso file and mount it, by selecting the menu scripts and then Mount Iso from the menu that appears when you right click something, then a terminal will popup asking you for your password, type your sudo password and that's all. The next script is for unmounting the iso image, and we do like this:
Script for unmounting the iso
open a terminal and type:
~$ gedit ~/.gnome2/nautilus-scripts/Unmount\ Iso
When the text editor showup put this code:
#!/bin/bash
for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
gnome-terminal -x sudo umount "$1"
done
Make executable by typing in the terminal:
~$ chmod +x ~/.gnome2/nautilus-scripts/Unmount\ Iso
Now you can mount and unmount iso files with just two clicks... hope this works for you, and make the life of some a little better. These are simple scripts, I guess that if you want to mount *.nrg or *.cue or something else the script will be the same just changing the filetype would be enough for the script to work. I will find out the filetypes for some other images and update the scripts within this weekend (if I'm free of homework).
I've tried the Heliode's code, but somehow it sometimes doesn't work in my machine, although you can use it instead of the code above, I just do it like this because of the failures of my machine, I don't know what I've done to it ](*,) , anyway, hope this code works for everyone.
Ok this code is now fixed with all the observations made from everyone, and correcting some mistakes I've made.
Script for Mounting an Iso
First we make the folder where the files are going to be mounted, open a terminal and type:
~$ sudo mkdir /media/iso (I prefer this becuse then I just go to the system and the iso folder will be next to the cdrom and/or floppy like an other dev)
In a terminal do:
~$ gedit ~/.gnome2/nautilus-scripts/Mount\ Iso
When gedit shows up write this code:
#!/bin/bash
for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
gnome-terminal -x sudo mount -o loop -t iso9660 "$1" /media/iso
done
Finally you have to make the file executable, to do so type in a terminal:
~$ chmod +x ~/.gnome2/nautilus-scripts/Mount\ Iso
Now you can right click on an iso file and mount it, by selecting the menu scripts and then Mount Iso from the menu that appears when you right click something, then a terminal will popup asking you for your password, type your sudo password and that's all. The next script is for unmounting the iso image, and we do like this:
Script for unmounting the iso
open a terminal and type:
~$ gedit ~/.gnome2/nautilus-scripts/Unmount\ Iso
When the text editor showup put this code:
#!/bin/bash
for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
gnome-terminal -x sudo umount "$1"
done
Make executable by typing in the terminal:
~$ chmod +x ~/.gnome2/nautilus-scripts/Unmount\ Iso
Now you can mount and unmount iso files with just two clicks... hope this works for you, and make the life of some a little better. These are simple scripts, I guess that if you want to mount *.nrg or *.cue or something else the script will be the same just changing the filetype would be enough for the script to work. I will find out the filetypes for some other images and update the scripts within this weekend (if I'm free of homework).
I've tried the Heliode's code, but somehow it sometimes doesn't work in my machine, although you can use it instead of the code above, I just do it like this because of the failures of my machine, I don't know what I've done to it ](*,) , anyway, hope this code works for everyone.