-
Notifications
You must be signed in to change notification settings - Fork 0
/
mountiso
executable file
·35 lines (30 loc) · 1.06 KB
/
mountiso
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
#===============================================================================
#
# FILE: mountiso
#
# USAGE: ./mountiso [isoname]
#
# DESCRIPTION: use fuseiso to mount iso images
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: adaptee (), adaptee@gmail.com
# COMPANY: Open Source Corporation
# VERSION: 1.0
# CREATED: 2009年12月27日 14时11分32秒 CST
# REVISION: ---
#===============================================================================
isoname=$( basename "$1" )
isonamewithoutextension=$(echo ${isoname%.*} )
mountpoint="${HOME}/Desktop/${isonamewithoutextension}"
if grep "$isoname" ~/.mtab.fuseiso > /dev/null ; then
# if already mounted, do nothing
exit
else
# '-p' means create and delete the mount point automatically
# when invokde in the name of xdg-open in desktop environment, open the mountpoint
fuseiso -p "$isoname" "$mountpoint" && [[ $(basename $0) == "xdg-mountiso" ]] && xdg-open "${mountpoint}"
fi