]> gitweb.fluxo.info Git - httruta.git/commitdiff
Fixing user and group if needed
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 25 Aug 2013 22:47:09 +0000 (19:47 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 25 Aug 2013 22:47:09 +0000 (19:47 -0300)
lib/httracker/functions

index e224c2dd9b87e2436a6fa3fd50f50154cebbbc96..0d3293a0f4547522b0f326feda822743a58ee690 100644 (file)
@@ -9,7 +9,6 @@ function httracker_get {
   local target="$MIRRORS/$hash"
 
   mkdir -p $target
-  #chown -R $USER.$GROUP $target/
 
   # We already got this one
   if [ -f "$target/ok" ]; then
@@ -36,6 +35,10 @@ 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_single {