From: Silvio Rhatto Date: Sun, 25 Aug 2013 22:47:09 +0000 (-0300) Subject: Fixing user and group if needed X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=489623ef3069b479788f91a6935b8061b9aab2ce;p=httruta.git Fixing user and group if needed --- diff --git a/lib/httracker/functions b/lib/httracker/functions index e224c2d..0d3293a 100644 --- a/lib/httracker/functions +++ b/lib/httracker/functions @@ -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 {