Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2017-05-25 01:13:28 +0300
committernachoparker <nacho@ownyourbits.com>2017-05-25 19:20:34 +0300
commit7ea3dbecd59efb7181dceec723f30e31e40693d2 (patch)
tree3cd9ca3b773da6461f8d24e58364b95a9234fcbc
parentc02bc6b520f37e11bcfeaad61f04694ee3f5bba7 (diff)
test for write permissions for mysql and www-data user for nc-datadir and nc-databasev0.12.2
-rw-r--r--etc/nextcloudpi-config.d/nc-database.sh2
-rw-r--r--etc/nextcloudpi-config.d/nc-datadir.sh2
2 files changed, 4 insertions, 0 deletions
diff --git a/etc/nextcloudpi-config.d/nc-database.sh b/etc/nextcloudpi-config.d/nc-database.sh
index 7f4da842..d998eea2 100644
--- a/etc/nextcloudpi-config.d/nc-database.sh
+++ b/etc/nextcloudpi-config.d/nc-database.sh
@@ -45,6 +45,8 @@ configure()
mkdir -p "$BASEDIR"
grep -q ext <( stat -fc%T $BASEDIR ) || { echo -e "Only ext filesystems can hold the database"; sleep 3; return 1; }
+
+ sudo -u mysql test -x $BASEDIR || { echo -e "ERROR: the user mysql does not have access permissions over $BASEDIR"; sleep 3; return 1; }
[[ $( stat -fc%d / ) == $( stat -fc%d $BASEDIR ) ]] && \
echo -e "INFO: moving database to another place in the same SD card\nIf you want to use an external mount, make sure it is properly set up"
diff --git a/etc/nextcloudpi-config.d/nc-datadir.sh b/etc/nextcloudpi-config.d/nc-datadir.sh
index 343741cb..fa8e8c88 100644
--- a/etc/nextcloudpi-config.d/nc-datadir.sh
+++ b/etc/nextcloudpi-config.d/nc-datadir.sh
@@ -46,6 +46,8 @@ configure()
grep -q ext <( stat -fc%T $BASEDIR ) || { echo -e "Only ext filesystems can hold the data directory"; sleep 3; return 1; }
+ sudo -u www-data test -x $BASEDIR || { echo -e "ERROR: the user www-data does not have access permissions over $BASEDIR"; sleep 3; return 1; }
+
[[ $( stat -fc%d / ) == $( stat -fc%d $BASEDIR ) ]] && \
echo -e "INFO: moving data dir to another place in the same SD card\nIf you want to use an external mount, make sure it is properly set up"