From f4243f4f2c6a97b7f226283d22d37c9a8a6266ea Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 25 Aug 2013 23:26:23 -0300 Subject: Fixing variable name --- lib/httracker/functions | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/lib/httracker/functions b/lib/httracker/functions index dcc8f4b..6d83b08 100644 --- a/lib/httracker/functions +++ b/lib/httracker/functions @@ -13,7 +13,7 @@ function httracker_opts { --purge-old=0 \ --index \ --cookies=1 \ - --path ${target}" + --path ${TARGET}" } # Download URLs, mirror mode @@ -22,14 +22,12 @@ function httracker_get { local url="$1" local hash="`echo $1 | sha1sum | cut -d ' ' -f 1`" - # Set target - target="$MIRRORS/$hash" - - # Make sure that target exists - mkdir -p $target + # Set target and make sure it exists + TARGET="$MIRRORS/$hash" + mkdir -p $TARGET # We already got this one - if [ -f "$target/ok" ]; then + if [ -f "$TARGET/ok" ]; then return fi @@ -43,7 +41,7 @@ function httracker_get { # Fix permissions if [ "`whoami`" != "$USER" ] && [ "`whoami`" == "root" ]; then - chown -R $USER.$GROUP $target/ + chown -R $USER.$GROUP $TARGET/ fi # Get each URL @@ -51,21 +49,21 @@ function httracker_get { if [ "$?" == "0" ]; then # Mark as downloaded - touch $target/ok + touch $TARGET/ok else echo "Error fetching $url." - rm -rf $target + rm -rf $TARGET fi } # Download URLs, incremental mode function httracker_get_incremental { - # Create target dir + # Create TARGET dir year=`date +%Y` month=`date +%m` day=`date +%d` - target=${MIRRORDIR}/${year}/${month} - sudo -u ${USER} mkdir -p ${target} + TARGET=${MIRRORDIR}/${year}/${month} + sudo -u ${USER} mkdir -p ${TARGET} # Basic options httracker_opts -- cgit v1.2.3