Skip to content

Commit

Permalink
test for write permissions for mysql and www-data user for nc-datadir…
Browse files Browse the repository at this point in the history
… and nc-database
  • Loading branch information
nachoparker committed May 25, 2017
1 parent c02bc6b commit 7ea3dbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions etc/nextcloudpi-config.d/nc-database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions etc/nextcloudpi-config.d/nc-datadir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 7ea3dbe

Please sign in to comment.