From: Silvio Rhatto Date: Fri, 2 Jun 2017 23:56:24 +0000 (-0300) Subject: Setup media folder with the right ownership at sync-tpc X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=4d5992e603df88fc4a2d706ef1d0be8de157a2fa;p=hydra.git Setup media folder with the right ownership at sync-tpc --- diff --git a/share/hydractl/sync-tpc b/share/hydractl/sync-tpc index 31a29ae..6c1b5d2 100755 --- a/share/hydractl/sync-tpc +++ b/share/hydractl/sync-tpc @@ -61,9 +61,11 @@ fi if [ ! -d "$MEDIA" ]; then $SUDO mkdir -p $MEDIA - if [ "$USER" != 'root' ]; then - $SUDO chown $USER.$USER $MEDIA - fi + OWNER="$(stat -c %U /var/cache/`hostname -s`/media)" + GROUP="$(stat -c %G /var/cache/`hostname -s`/media)" + + # With the right permissions + $SUDO chown $OWNER.$GROUP $MEDIA fi # Sync media remotes