diff options
author | Juergen Daubert <jue@jue.li> | 2015-09-25 11:43:38 +0200 |
---|---|---|
committer | Juergen Daubert <jue@jue.li> | 2015-09-25 11:43:38 +0200 |
commit | f54e7f32efa39cbb6ee645ae3ef996cc72be6c4b (patch) | |
tree | 48a666f8d4cc5a2bd5723613e8db01fd1b186446 | |
parent | 84b8d3e662b7b387f699dbd82f0406a8eba5045e (diff) | |
download | prt-utils-f54e7f32efa39cbb6ee645ae3ef996cc72be6c4b.tar.gz prt-utils-f54e7f32efa39cbb6ee645ae3ef996cc72be6c4b.tar.xz |
pkgsize: fix content-length evaluation and whitespaces
-rw-r--r-- | pkgsize | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -57,17 +57,16 @@ function sizetodownload() { sizeofdl="" if [ "$testhttp" = "http" ]; then - wget $FILE -S --spider 2> $TMP_WGET - if [ $? -ne 0 ] && [ $nrbytes -eq 0 ] - then - error "Not online, or no wget installed. " - clean - exit 1 - fi - sizeofdl=`cat $TMP_WGET | awk '/Content-Length/{print $3}'` - rm $TMP_WGET - - fi + wget $FILE -S --spider 2> $TMP_WGET + if [ $? -ne 0 ] && [ $nrbytes -eq 0 ]; then + error "Not online, or no wget installed. " + clean + exit 1 + fi + sizeofdl=`cat $TMP_WGET | awk '/Content-Length/{print $2}'` + rm $TMP_WGET + fi + if [ -z "$sizeofdl" ]; then sizeofdl=0 # echo "sizeofdl - $sizeofdl" |