You are not logged in.

#1 2008-02-16 12:23:05

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

ISO file mounter & umounter Script

Hi! i write this ISO mounter script, it mounts the iso file passed as a parameter and then umount it, the only thing is that you might have a /mnt layout as follows:

/mnt/iso1
/mnt/iso2
/mnt/iso3
/mnt/iso4
/mnt/cdrom

#!/bin/bash
# Usage: mountiso [isofile]
echo Select the mount point:
echo 1. /mnt/iso1
echo 2. /mnt/iso2
echo 3. /mnt/iso3
echo 4. /mnt/iso4
echo 5. /mnt/cdrom
read point
while [ "$point" != "1" ] && [ "$point" != "2" ] && [ "$point" != "3" ] && [ "$point" != "4" ] && [ "$point" != "5" ]; do
    echo invalid option
    echo Select a valid mount point
    read point
done
case $point in
1) mount -o loop -t iso9660 "$1" /mnt/iso1 && echo $1 mounted to /mnt/iso1 && echo --- Press a key to umount --- && read && umount /mnt/iso1 && echo /mnt/iso1 umounted;;
2) mount -o loop -t iso9660 "$1" /mnt/iso2 && echo $1 mounted to /mnt/iso2 && echo --- Press a key to umount --- && read && umount /mnt/iso2 && echo /mnt/iso2 umounted;;
3) mount -o loop -t iso9660 "$1" /mnt/iso3 && echo $1 mounted to /mnt/iso3 && echo --- Press a key to umount --- && read && umount /mnt/iso3 && echo /mnt/iso3 umounted;;
4) mount -o loop -t iso9660 "$1" /mnt/iso4 && echo $1 mounted to /mnt/iso4 && echo --- Press a key to umount --- && read && sudo umount /mnt/iso4 && echo /mnt/iso4 umounted;;
5) mount -o loop -t iso9660 "$1" /mnt/cdrom && echo $1 mounted to /mnt/cdrom && echo --- Press a key to umount --- && read && sudo umount /mnt/cdrom && echo /mnt/cdrom umounted;;
*)
esac

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#2 2008-03-04 18:59:37

/devnull.nsb
Member
From: USA
Registered: 2008-03-03
Posts: 10

Re: ISO file mounter & umounter Script

Kewl, I was just about to write a post asking if there was something like DAEMON tools for arch...  I am a newbie at Archlinux and Linux somewhat as a whole.. Could you explain if you have the time, How I would use this script to mount a file ISO, in specifics one which has .NRG file extension....

Thanks in advance for your time!

Offline

#3 2008-03-04 19:14:16

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: ISO file mounter & umounter Script

pacman -S nrg2iso

The .nrg is probably a .iso file already wink

Offline

Board footer

Powered by FluxBB