aboutsummaryrefslogtreecommitdiff
path: root/lib/httracker/functions
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-08-25 20:32:51 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-08-25 20:32:51 -0300
commit9b31f277031e58b6125018161cb9764d445a61b7 (patch)
tree0911ad8aa9352681ad7564aa1499ba1f4b51ff6b /lib/httracker/functions
parent5750eef890738d2a2a59e4de80871823de147424 (diff)
downloadhttruta-9b31f277031e58b6125018161cb9764d445a61b7.tar.gz
httruta-9b31f277031e58b6125018161cb9764d445a61b7.tar.bz2
Adding OPTS
Diffstat (limited to 'lib/httracker/functions')
-rw-r--r--lib/httracker/functions17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/httracker/functions b/lib/httracker/functions
index aa64fcb..ba68e50 100644
--- a/lib/httracker/functions
+++ b/lib/httracker/functions
@@ -15,6 +15,12 @@ function httracker_get {
return
fi
+ if [ "`whoami`" == "root" ]; then
+ OPTS="--user $USER"
+ else
+ OPTS=""
+ fi
+
# Get each URL
httrack \
--mirror \
@@ -24,8 +30,7 @@ function httracker_get {
--index \
--cookies=1 \
--path ${target} \
- -r${LEVEL} ${url}
- #--user $USER \
+ -r${LEVEL} ${OPTS} ${url}
#-e%${EXT_LEVEL} \
#-m$FILESIZE \
#--verbose
@@ -51,6 +56,12 @@ function httracker_get_incremental {
target=${MIRRORDIR}/${year}/${month}
sudo -u links mkdir -p ${target}
+ if [ "`whoami`" == "root" ]; then
+ OPTS="--user $USER"
+ else
+ OPTS=""
+ fi
+
# Grabs URLs from the network
httrack --verbose \
--mirror \
@@ -61,7 +72,7 @@ function httracker_get_incremental {
--index \
--cookies=1 \
--list ${URLS} \
- --path ${target}
+ --path ${target} ${OPTS}
}