diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/httracker/functions | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/httracker/functions b/lib/httracker/functions index 56db0f6..f43dae7 100644 --- a/lib/httracker/functions +++ b/lib/httracker/functions @@ -45,6 +45,9 @@ function httracker_get { # Basic options httracker_opts + # Log options + OPTS="$OPTS --file-log $LOG" + # Additional options if [ "`whoami`" == "root" ]; then OPTS="$OPTS --user $USER" @@ -57,13 +60,7 @@ function httracker_get { fi # Get each URL - httrack ${OPTS} ${url} | tee $LOG - - # Fix permissions again - if [ "`whoami`" != "$USER" ] && [ "`whoami`" == "root" ]; then - echo "Fixing $TARGET permissions again..." - chown -R $USER.$GROUP $TARGET/ - fi + httrack ${OPTS} ${url} if [ "$?" == "0" ]; then # Mark as downloaded @@ -72,6 +69,12 @@ function httracker_get { echo "Error fetching $url." rm -rf $TARGET fi + + # Fix permissions again + if [ "`whoami`" != "$USER" ] && [ "`whoami`" == "root" ]; then + echo "Fixing $TARGET permissions again..." + chown -R $USER.$GROUP $TARGET/ + fi } # Download URLs, incremental mode |