Skip to content

Instantly share code, notes, and snippets.

@syneart
Created May 17, 2016 13:08
Show Gist options
  • Save syneart/c753d79a53e5cd0508266662c2415193 to your computer and use it in GitHub Desktop.
Save syneart/c753d79a53e5cd0508266662c2415193 to your computer and use it in GitHub Desktop.
This is a mount iso files bash for Ubuntu.
#!/bin/bash
clear
echo "Please input the iso file in here [Nothing input will unmount]"
read -p ">> " srcinputfile
clear
mntPath=/media/isofileceh
if ["$srcinputfile" == ""] 2>/dev/null ; then
sudo umount "$mntPath" 1>/dev/null 2>/dev/null
sudo rmdir "$mntPath" 1>/dev/null 2>/dev/null
echo The iso file is unmounted !
else
sudo mkdir "$mntPath" 1>/dev/null 2>/dev/null
sudo umount "${srcinputfile//\'/}" 1>/dev/null 2>/dev/null
sudo mount "${srcinputfile//\'/}" "$mntPath" -o loop 1>/dev/null 2>/dev/null
echo This iso file is mounted read-only.
nautilus "$mntPath"
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment