diff --git a/README b/README index 1b2fa80..3448d49 100644 --- a/README +++ b/README @@ -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. diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..f68b956 --- /dev/null +++ b/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.'