From 760dd7f19657548a9887d943753fa36219745c95 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 12 Mar 2016 13:50:36 +0000 Subject: [PATCH] owncloud config file ownership --- src/freedombone-restore-local | 6 ++++-- src/freedombone-restore-remote | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/freedombone-restore-local b/src/freedombone-restore-local index e693dbc1..beaa4302 100755 --- a/src/freedombone-restore-local +++ b/src/freedombone-restore-local @@ -825,6 +825,7 @@ function restore_owncloud { return fi fi + OWNCLOUD_PATH=/var/www/owncloud if [ $OWNCLOUD_DOMAIN_NAME ]; then restore_database owncloud $OWNCLOUD_DOMAIN_NAME @@ -849,11 +850,12 @@ function restore_owncloud { fi # re-index the files - chown -R www-data:www-data /var/www/owncloud + chown -R www-data:www-data $OWNCLOUD_PATH + chown root:root $OWNCLOUD_PATH/config/config.php for d in /home/*/ ; do USERNAME=$(echo "$d" | awk -F '/' '{print $3}') if [[ $USERNAME != "git" && $USRNAME != "mirrors" ]]; then - /var/www/owncloud/occ files:scan $USERNAME + $OWNCLOUD_PATH/occ files:scan $USERNAME fi done fi diff --git a/src/freedombone-restore-remote b/src/freedombone-restore-remote index b7fb85e1..5702201c 100755 --- a/src/freedombone-restore-remote +++ b/src/freedombone-restore-remote @@ -699,6 +699,7 @@ function restore_owncloud { return fi fi + OWNCLOUD_PATH=/var/www/owncloud if grep -q "Owncloud domain" $COMPLETION_FILE; then OWNCLOUD_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Owncloud domain" | awk -F ':' '{print $2}') restore_database_from_friend owncloud $OWNCLOUD_DOMAIN_NAME @@ -721,13 +722,14 @@ function restore_owncloud { rm -rf /root/tempowncloudconfig fi - chown -R www-data:www-data /var/www/owncloud + chown -R www-data:www-data $OWNCLOUD_PATH + chown root:root $OWNCLOUD_PATH/config/config.php # re-index files for d in /home/*/ ; do USERNAME=$(echo "$d" | awk -F '/' '{print $3}') if [[ $USERNAME != "git" && $USRNAME != "mirrors" ]]; then - /var/www/owncloud/occ files:scan $USERNAME + $OWNCLOUD_PATH/occ files:scan $USERNAME fi done fi