Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
encrypted-image-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ai
encrypted-image-tools
Commits
5a2c762e
Commit
5a2c762e
authored
8 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
make detach_img idempotent
parent
ceae320d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
imgtool
+12
-0
12 additions, 0 deletions
imgtool
with
12 additions
and
0 deletions
imgtool
+
12
−
0
View file @
5a2c762e
...
...
@@ -99,8 +99,20 @@ attach_img() {
fi
}
is_mounted
()
{
local
mountpoint
=
"
$1
"
local
mountpoint_abs
=
"
$(
cd
"
${
mountpoint
}
"
&&
pwd
)
"
local
tmp
=
$(
mount |
awk
"
\$
1 ==
\"
${
mountpoint_abs
}
\"
"
)
if
[
-z
"
${
tmp
}
"
]
;
then
return
1
else
return
0
fi
}
detach_img
()
{
local
mountpoint
=
"
$1
"
is_mounted
"
${
mountpoint
}
"
||
return
0
case
${
OS
}
in
Darwin
)
sudo
hdiutil detach
"
${
mountpoint
}
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment