![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
5 Cups of Ubuntu
![]() Join Date: Apr 2005
Beans: 15
|
HOWTO: Nautilus Script to mount .iso files
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
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 Last edited by animacide; December 22nd, 2005 at 07:59 AM.. Reason: Improved mounting script |
|
|
|
|
|
#2 |
|
Guest
Beans: n/a
|
Re: HOWTO: Nautilus Script to mount .iso files
I have added these scripts to the Ubuntu Document Storage Facility
|
|
|
|
#3 |
|
Gee! These Aren't Roasted!
![]() Join Date: Nov 2004
Beans: 207
|
Re: HOWTO: Nautilus Script to mount .iso files
Great script man! Thank you for posting it!
|
|
|
|
|
|
#4 |
|
Way Too Much Ubuntu
![]() |
Re: HOWTO: Nautilus Script to mount .iso files
One problem with this script, is, that if it is not possible to mount the iso file, it still creates a directory in /media. And it is not deleted. This can lead to heavy "clutter" after a while.
|
|
|
|
|
|
#5 |
|
Gee! These Aren't Roasted!
![]() Join Date: Oct 2005
Location: Louisville KY (USA)
Beans: 179
Ubuntu Breezy 5.10
|
Re: HOWTO: Nautilus Script to mount .iso files
I am going to see if I can use this to get a LIVE USB setup working that we are trying in thread 71567
DAVE
__________________
( If you don't care who gets the credit ... great things can be accomplished. )
Setup Guide: "Installing Ubuntu on an external USB Drive" Good Starter Book: "Linux Desktop Pocket Guide" |
|
|
|
|
|
#6 |
|
First Cup of Ubuntu
![]() Join Date: Sep 2005
Beans: 1
|
Re: HOWTO: Nautilus Script to mount .iso files
This doesn't work with any ISO file that is outside your home directory, other than that, great script
|
|
|
|
|
|
#7 |
|
Just Give Me the Beans!
![]() Join Date: Jul 2005
Beans: 53
|
Re: HOWTO: Nautilus Script to mount .iso files
great script! thanks
|
|
|
|
|
|
#8 |
|
Way Too Much Ubuntu
![]() Join Date: Oct 2005
Location: Southeast Asia
My beans are hidden!
Ubuntu 7.04 Feisty Fawn
|
Re: HOWTO: Nautilus Script to mount .iso files
Great little script! Is there a way to modify the ISO contents if locally mounted?
RattyMan, I can, and I can even mount an ISO stored in my ntfs partition. Do you have root enabled? |
|
|
|
|
|
#9 |
|
5 Cups of Ubuntu
![]() Join Date: Apr 2005
Beans: 15
|
Re: HOWTO: Nautilus Script to mount .iso files
Just wanted to let everyone know that I've updated the mounting script to be more error tolerant. Now if an error occurs it tells you and it cleans up after itself by removing the directory in media. I also borrowed an idea from another thread where Gandalf added optional nautilus open. Hope this helps. I may also try to convert this into a Nautilus Actions style script so it only shows up on the context menu of appropriate .iso files.
|
|
|
|
|
|
#10 | |
|
5 Cups of Ubuntu
![]() Join Date: Apr 2005
Beans: 15
|
Re: HOWTO: Nautilus Script to mount .iso files
Quote:
|
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|