Refactor web_get() and add progress
This commit is contained in:
parent
3a86f6c2dd
commit
0dcbe75fb5
10
quickemu
10
quickemu
|
@ -5,12 +5,10 @@ function web_get() {
|
||||||
local URL="${1}"
|
local URL="${1}"
|
||||||
local FILE=""
|
local FILE=""
|
||||||
FILE="${URL##*/}"
|
FILE="${URL##*/}"
|
||||||
if [ ! -e "${VMDIR}/${FILE}" ]; then
|
mkdir -p "${VMDIR}" 2>/dev/null
|
||||||
mkdir -p "${VMDIR}" 2>/dev/null
|
if ! wget --quiet --continue --show-progress --progress=bar:force:noscroll "${URL}" -O "${VMDIR}/${FILE}"; then
|
||||||
if ! wget -q -c "${URL}" -O "${VMDIR}/${FILE}"; then
|
echo "ERROR! Failed to download ${URL}"
|
||||||
echo "ERROR! Failed to download ${URL}"
|
exit 1
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue