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-20 13:42:35 +0300
committernachoparker <nacho@ownyourbits.com>2017-05-22 19:55:45 +0300
commitaddd0a8bec9dde406fa80075226a374e7b0ba868 (patch)
tree7b0b599bf6b130c52740cb2e84876ee4070865aa
parent0f0c8601ef03d6d06840ad5ddd1f7e1d43494485 (diff)
check destination filesystem in nc-datadir nc-databasedirv0.8.8
-rwxr-xr-xetc/nextcloudpi-config.d/nc-database.sh11
-rwxr-xr-xetc/nextcloudpi-config.d/nc-datadir.sh12
2 files changed, 23 insertions, 0 deletions
diff --git a/etc/nextcloudpi-config.d/nc-database.sh b/etc/nextcloudpi-config.d/nc-database.sh
index ce6c0917..7f4da842 100755
--- a/etc/nextcloudpi-config.d/nc-database.sh
+++ b/etc/nextcloudpi-config.d/nc-database.sh
@@ -18,6 +18,15 @@
DBDIR_=/media/USBdrive/ncdatabase
DESCRIPTION="Move your database to a new location, like a USB drive"
+show_info()
+{
+ whiptail --yesno \
+ --backtitle "NextCloudPi configuration" \
+ --title "Info" \
+"Note that non Unix filesystems such as NTFS are not supported
+because they do not provide a compatible user/permissions system" \
+ 20 90
+}
configure()
{
@@ -35,6 +44,8 @@ configure()
local BASEDIR=$( dirname "$DBDIR_" )
mkdir -p "$BASEDIR"
+ grep -q ext <( stat -fc%T $BASEDIR ) || { echo -e "Only ext filesystems can hold the database"; 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 dd17901f..343741cb 100755
--- a/etc/nextcloudpi-config.d/nc-datadir.sh
+++ b/etc/nextcloudpi-config.d/nc-datadir.sh
@@ -18,6 +18,16 @@
DATADIR_=/media/USBdrive/ncdata
DESCRIPTION="Change your data dir to a new location, like a USB drive"
+show_info()
+{
+ whiptail --yesno \
+ --backtitle "NextCloudPi configuration" \
+ --title "Info" \
+"Note that non Unix filesystems such as NTFS are not supported
+because they do not provide a compatible user/permissions system" \
+ 20 90
+}
+
configure()
{
local SRCDIR=$( cd /var/www/nextcloud; sudo -u www-data php occ config:system:get datadirectory )
@@ -34,6 +44,8 @@ configure()
local BASEDIR=$( dirname "$DATADIR_" )
mkdir -p "$BASEDIR"
+ grep -q ext <( stat -fc%T $BASEDIR ) || { echo -e "Only ext filesystems can hold the data directory"; 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"