blob: d2ff5bea12d917bed10357019bdc1a92cc128ca7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#!/bin/bash
download()
{
tput civis
local url=$1
echo -n " "
wget -nc -q --show-progress --progress=dot "$url" 2>&1 | grep --line-buffered "%" | \
sed -u -e "s,\.,,g" | awk '{printf("\b\b\b\b%4s", $2)}'
local retval="${PIPESTATUS[0]}"
if [ "${retval}" -ne 0 ]; then
printf "%b" "${RED}FAILED! WGET EXIT (${retval})\n${RST}"
exit "${retval}"
fi
printf "%b" "\b\b\b\b\n"
tput cnorm
}
export -f download
|