Skip to content
This repository has been archived by the owner on Nov 22, 2021. It is now read-only.

Commit

Permalink
Ad hoc installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
l0b0 committed Jan 12, 2011
1 parent a2b4cfa commit f08e157
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
20 changes: 7 additions & 13 deletions README
Expand Up @@ -5,26 +5,20 @@ This has been tested with ISO and NRG files.

INSTALL

Simply copy the following lines into a terminal window and press Enter. This installs the scripts for the current user.
git clone https://github.com/l0b0/mount-image.git && sudo mount-image/install.sh

### code start ###
wget --quiet --no-check-certificate --directory-prefix=$HOME/.gnome2/nautilus-scripts/ \
https://github.com/l0b0/mount-image/raw/master/mount-image \
https://github.com/l0b0/mount-image/raw/master/umount-image \
https://github.com/l0b0/mount-image/raw/master/common.sh && \
chmod u+x $HOME/.gnome2/nautilus-scripts/{,u}mount-image && \
sudo ln -s $HOME/.gnome2/nautilus-scripts/{,u}mount-image /usr/local/bin
### code end ###
Now you can remove the mount-image directory.


RUN

$ mount-image /path/to/some.iso
$ umount-image /path/to/some.iso

In Nautilus (the GNOME file manager):
Right-click an image file, select "Scripts", and then "mount-image" or "unmount-image".

On the shell:
$ mount-image /path/to/some.iso
$ umount-image /path/to/some.iso

Both methods take multiple files - You can
$ mount-image *.iso
$ mount-image *.{iso,nrg}
and use the script on selected files in Nautilus.
24 changes: 24 additions & 0 deletions install.sh
@@ -0,0 +1,24 @@
#!/bin/sh
fail()
{
echo 'Installation failed! Please submit a bug report at'
echo 'https://github.com/l0b0/mount-image/issues'
echo 'with a copy of the output.'
exit 1
}

# Get directory of this script
full_path="$(readlink -fn -- "$0")" || fail
dir="$(dirname -- "$full_path")" || fail

# Move files in place
cp -v -- "${dir}/common.sh" "${dir}/mount-image" "${dir}/umount-image" /usr/local/bin || fail

# Make the scripts executable
chmod a+x -- /usr/local/bin/mount-image /usr/local/bin/umount-image || fail

# Import the Nautilus settings (run for each user)
gconftool-2 --load mount-image/nautilus-actions/* || fail

# Success
echo 'Installation succeeded. Please see the README file for usage instructions.'

0 comments on commit f08e157

Please sign in to comment.