Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-image
Commits
6854000a
Commit
6854000a
authored
Sep 02, 2013
by
Nikos Skalkotos
Browse files
Add usage info in snf-image-update-helper
parent
2c8bf79a
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-image-host/snf-image-update-helper.in
View file @
6854000a
...
...
@@ -22,6 +22,62 @@ set -o errtrace
.
@osdir@/common.sh
usage
()
{
local
rc
=
"
$1
"
cat
<<
EOF
Usage:
$0
[options]
This script will download a suitable fixed snf-image-helper image and will
install it under
$IMAGE_DIR
.
OPTIONS:
-h Print this message
-y Assume Yes to all queries and do not prompt
EOF
exit
"
$rc
"
}
while
getopts
"hy"
opt
;
do
case
$opt
in
h
)
usage 0
;;
y
)
NO_PROMPT
=
"yes"
;;
?
)
log_error
"User
\`
-h' for help"
;
exit
1
;;
esac
done
cat
>
&1
<<
EOF
This program will overwrite the following files if present:
\`
$HELPER_DIR
/initrd'
\`
$HELPER_DIR
/kernel'
\`
$HELPER_DIR
/initrd-xen'
\`
$HELPER_DIR
/kernel-xen'
\`
$HELPER_DIR
/image'
\`
$HELPER_DIR
/packages'
EOF
while
[[
1
]]
;
do
echo
-n
"Do you want to continue [y/N]? "
if
[
"x
$NO_PROMPT
"
=
"xyes"
]
;
then
echo
"y"
;
break
;
fi
read
answer
[
"
$(
echo
-n
"
$answer
"
|
tr
[
A-Z]
[
a-z]
)
"
=
"y"
]
&&
break
if
[
-z
"
$answer
"
-o
"
$(
echo
-n
"
$answer
"
|
tr
[
A-Z]
[
a-z]
)
"
=
"n"
]
;
then
log_error
"Abort."
exit
1
fi
done
IMAGE_DIR
=
$(
mktemp
-d
)
add_cleanup
rmdir
"
$IMAGE_DIR
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment