]> gitweb.fluxo.info Git - httruta.git/commitdiff
Fix permissions twice
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 28 Aug 2013 19:45:55 +0000 (16:45 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 28 Aug 2013 19:45:55 +0000 (16:45 -0300)
lib/httracker/functions

index 929d9170aa2b89dd9efe9c2d2ecd2a23b91155b0..5c45f9b10d9c906abd0d8be887b0b067febeff50 100644 (file)
@@ -52,6 +52,11 @@ function httracker_get {
   # Get each URL
   httrack ${OPTS} ${url} | tee $LOG
 
+  # Fix permissions again
+  if [ "`whoami`" != "$USER" ] && [ "`whoami`" == "root" ]; then
+    chown -R $USER.$GROUP $TARGET/
+  fi
+
   if [ "$?" == "0" ]; then
     # Mark as downloaded
     touch $TARGET/httracker-ok
@@ -80,6 +85,11 @@ function httracker_get_incremental {
 
   # Grab URLs from the network
   httrack ${OPTS} --list ${URLS} | tee $LOG
+
+  # Fix permissions again
+  if [ "`whoami`" != "$USER" ] && [ "`whoami`" == "root" ]; then
+    chown -R $USER.$GROUP $TARGET/
+  fi
 }
 
 # Get SemanticScuttle parameter