Skip to content

Commit

Permalink
nc-datadir: refuse to move to SD card
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Nov 16, 2017
1 parent ba76566 commit 370fc74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

[v0.34.15](https://github.com/nextcloud/nextcloudpi/commit/97febf5) (2017-11-16) update: check existence ncp.conf
[v0.34.16](https://github.com/nextcloud/nextcloudpi/commit/de92843) (2017-11-17) nc-datadir: refuse to move to SD card

[v0.34.15](https://github.com/nextcloud/nextcloudpi/commit/868924c) (2017-11-16) update: check existence ncp.conf

[v0.34.14](https://github.com/nextcloud/nextcloudpi/commit/206b6de) (2017-11-16) update: check return code

Expand Down
6 changes: 4 additions & 2 deletions etc/nextcloudpi-config.d/nc-datadir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ configure()

sudo -u www-data test -x "$BASEDIR" || { echo -e "ERROR: the user www-data does not have access permissions over $BASEDIR"; 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"
[[ $( stat -fc%d / ) == $( stat -fc%d "$BASEDIR" ) ]] && {
echo "Refusing to move to the SD card. Abort"
return 1
}

## COPY
cd /var/www/nextcloud
Expand Down

0 comments on commit 370fc74

Please sign in to comment.