]> gitweb.fluxo.info Git - httruta.git/commitdiff
Fix permissions before fetching links
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 25 Aug 2013 23:35:10 +0000 (20:35 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 25 Aug 2013 23:35:10 +0000 (20:35 -0300)
lib/httracker/functions

index ba68e5039a12b991a263a58c0261ccf9d7c16567..40a9290845b970adef07283fa52d4761f31a634a 100644 (file)
@@ -21,6 +21,10 @@ function httracker_get {
     OPTS=""
   fi
 
+  if [ "`whoami`" != "$USER" ] && [ "`whoami`" == "root" ]; then
+    chown -R $USER.$GROUP $target/
+  fi
+
   # Get each URL
   httrack               \
     --mirror            \
@@ -42,10 +46,6 @@ function httracker_get {
     echo "Error fetching $url."
     rm -rf $target
   fi
-
-  if [ "`whoami`" != "$USER" ] && [ "`whoami`" == "root" ]; then
-    chown -R $USER.$GROUP $target/
-  fi
 }
 
 function httracker_get_incremental {