Commit b3ee0d57 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

update-helper: add option for omitting checksum

Add an option in snf-image-update-helper for omitting the checksum check
of the helper image.

This resolves #64
parent a7f144a8
......@@ -41,6 +41,10 @@ This script will download a suitable fixed snf-image-helper image and will
install it under $HELPER_DIR.
OPTIONS:
-c Don't check the checksum of the helper image
-f Force the installation even if the snf-image and helper versions don't match
-h Print this message
-u URL
......@@ -48,8 +52,6 @@ OPTIONS:
-y Assume Yes to all queries and do not prompt
-f Force the installation even if the snf-image and helper versions don't match
EOF
exit "$rc"
......@@ -57,14 +59,16 @@ EOF
while getopts "hu:yf" opt; do
case $opt in
c) NO_CHECKSUM="yes"
;;
f) FORCE="yes"
;;
h) usage 0
;;
u) HELPER_URL="$OPTARG"
;;
y) NO_PROMPT="yes"
;;
f) FORCE="yes"
;;
?) log_error "User \`-h' for help"; exit 1
;;
esac
......@@ -119,20 +123,23 @@ if [ $RET -ne 0 -a $RET -ne 141 ]; then
exit 1
fi
add_cleanup rm -f "$IMAGE_DIR/$IMAGE.md5sum"
set +e
$CURL -O -L -f "$HELPER_URL.md5sum"
RET=$?
set -e
if [ "x$NO_CHECKSUM" != "xyes" ]; then
echo "Checking the helper image checksum ..." >&2
add_cleanup rm -f "$IMAGE_DIR/$IMAGE.md5sum"
set +e
$CURL -O -L -f "$HELPER_URL.md5sum"
RET=$?
set -e
# See above for an explanation
if [ $RET -ne 0 -a $RET -ne 141 ]; then
log_error "Downloading "$IMAGE.md5sum" from "$HELPER_URL.md5sum" failed"
exit 1
fi
# See above for an explaination
if [ $RET -ne 0 -a $RET -ne 141 ]; then
log_error "Downloading "$IMAGE.md5sum" from "$HELPER_URL.md5sum" failed"
exit 1
$MD5SUM -c "$IMAGE_DIR/$IMAGE.md5sum"
fi
$MD5SUM -c "$IMAGE_DIR/$IMAGE.md5sum"
cd "$HELPER_DIR"
echo >&2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment