From dee63f93f4bf4bfb4d9fcdaeadfb2c5f3f3490ac Mon Sep 17 00:00:00 2001 From: opi Date: Thu, 4 Dec 2014 11:44:02 +0100 Subject: [PATCH] [fix] Better directories and files permissions. --- scripts/install | 8 ++++---- scripts/upgrade | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index 96846ab..738dbf5 100644 --- a/scripts/install +++ b/scripts/install @@ -30,10 +30,10 @@ sudo apt-get install transmission-daemon -y -qq # Make directories and set rights sudo mkdir -p /home/yunohost.transmission/{progress,completed} -sudo chgrp debian-transmission /home/yunohost.transmission/{progress,completed} -sudo chmod 755 -R /home/yunohost.transmission -sudo chmod 770 -R /home/yunohost.transmission/{progress,completed} -sudo chown -R www-data /home/yunohost.transmission/completed +sudo chown -R debian-transmission:debian-transmission /home/yunohost.transmission/ +sudo chown -R debian-transmission:www-data /home/yunohost.transmission/completed +sudo find /home/yunohost.transmission/ -type f | while read LINE; do sudo chmod 640 "$LINE" ; done +sudo find /home/yunohost.transmission/ -type d | while read LINE; do sudo chmod 750 "$LINE" ; done # Configure Transmission and reload sed -i "s@PATHTOCHANGE@$path@g" ../conf/settings.json diff --git a/scripts/upgrade b/scripts/upgrade index 7e12052..1219a22 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,9 +15,10 @@ sudo apt-get install transmission-daemon -y -qq # Make directories and set rights sudo mkdir -p /home/yunohost.transmission/{progress,completed} -sudo chgrp debian-transmission /home/yunohost.transmission/{progress,completed} -sudo chmod 755 -R /home/yunohost.transmission -sudo chmod 770 -R /home/yunohost.transmission/{progress,completed} +sudo chown -R debian-transmission:debian-transmission /home/yunohost.transmission/ +sudo chown -R debian-transmission:www-data /home/yunohost.transmission/completed +sudo find /home/yunohost.transmission/ -type f | while read LINE; do sudo chmod 640 "$LINE" ; done +sudo find /home/yunohost.transmission/ -type d | while read LINE; do sudo chmod 750 "$LINE" ; done # Configure Transmission and reload sed -i "s@PATHTOCHANGE@$path@g" ../conf/settings.json