aboutsummaryrefslogtreecommitdiff
path: root/lib/httracker/functions
diff options
context:
space:
mode:
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}
}