]> gitweb.fluxo.info Git - httruta.git/commitdiff
Adding OPTS
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 25 Aug 2013 23:32:51 +0000 (20:32 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 25 Aug 2013 23:32:51 +0000 (20:32 -0300)
lib/httracker/functions

index aa64fcbad6087c7ff5355548a7b87788874b4ca3..ba68e5039a12b991a263a58c0261ccf9d7c16567 100644 (file)
@@ -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}
 
 }