Created
May 17, 2016 13:08
-
-
Save syneart/c753d79a53e5cd0508266662c2415193 to your computer and use it in GitHub Desktop.
This is a mount iso files bash for Ubuntu.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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