From 169c3247525e9a448fd1f87c2139577fe02acb72 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 10 Mar 2018 20:25:42 +0800 Subject: Add error code EC_FETCH for fetch --- dfly-update | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dfly-update b/dfly-update index e54dba7..561adc0 100755 --- a/dfly-update +++ b/dfly-update @@ -25,6 +25,7 @@ EC_OS=10 EC_TMPFILE=11 EC_MD5=12 EC_ARGS=13 +EC_FETCH=14 # @@ -162,7 +163,7 @@ get_latest_image() { local tmpchecksum=$(mktemp -t ${NAME}) || exit ${EC_TMPFILE} local latest_filename latest_md5 line echo "Fetch remote systems checksum: ${url_checksum}" >&2 - fetch -q -o ${tmpchecksum} "${url_checksum}" + fetch -q -o ${tmpchecksum} "${url_checksum}" || exit ${EC_FETCH} if is_master_branch "${branch}"; then line=$(fgrep '.img.bz2' ${tmpchecksum} | tail -n 1) else @@ -246,7 +247,9 @@ download_image() { echo " => ${outfile}" fetch -o "${outfile}" "${url}" \ && echo "DONE" \ - || exit $? + || exit ${EC_FETCH} +} + } -- cgit v1.2.2