wget rate-limiting, patch from Nathan Buchanan <nbinont gmail com>

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16523 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Joshua Sled
2007-09-12 02:46:47 +00:00
parent b2fe372a71
commit de47952f34
2 changed files with 8 additions and 2 deletions
+1
View File
@@ -23,6 +23,7 @@
# DISABLE_OPTIMIZATIONS=yes
# AQBANKING_WITH_QT=no
# GLOBAL_DIR=Z:\\mydir # all directories will use this
# WGET_RATE=50k #limit download bandwith to 50KB/s
# late_eval 'INSTALL_DIR=$GNUCASH_DIR\\myinst' # no need to define GNUCASH_DIR
# block_step inst_docs
# late_eval 'add_step greetings'
+7 -2
View File
@@ -56,8 +56,13 @@ function smart_wget() {
# download the file to the tmpdir and then when that completes
# move it to the dest dir.
if [ ! -f $_DLD/$_FILE ] ; then
wget --passive-ftp -c $1 -P $TMP_UDIR
mv $TMP_UDIR/$_FILE $_DLD
# If WGET_RATE is set (in bytes/sec), limit download bandwith
if [ ! -z "$WGET_RATE" ] ; then
wget --passive-ftp -c $1 -P $TMP_UDIR --limit-rate=$WGET_RATE
else
wget --passive-ftp -c $1 -P $TMP_UDIR
fi
mv $TMP_UDIR/$_FILE $_DLD
fi
LAST_FILE=$_DLD/$_FILE
}