aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-08-25 19:47:09 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-08-25 19:47:09 -0300
commit489623ef3069b479788f91a6935b8061b9aab2ce (patch)
tree1a1076c362f324fda460ae94dfb40071afd7e10e
parent54608600f97dd28b2aa099ecb21e075b24357d86 (diff)
downloadhttruta-489623ef3069b479788f91a6935b8061b9aab2ce.tar.gz
httruta-489623ef3069b479788f91a6935b8061b9aab2ce.tar.bz2
Fixing user and group if needed
-rw-r--r--lib/httracker/functions5
1 files changed, 4 insertions, 1 deletions
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 {