improve btrfs/ext checks

Signed-off-by: nachoparker <nacho@ownyourbits.com>
This commit is contained in:
nachoparker 2021-09-19 18:44:37 -06:00
parent f3e3b01ab5
commit 311cd2b769
3 changed files with 4 additions and 2 deletions

View File

@ -33,7 +33,7 @@ DATADIR="$( grep datadirectory nextcloud/config/config.php | awk '{ print $3 }'
[[ -d /var/www/nextcloud-old ]] && { echo "Nextcloud backup directory found. Interrupted or already running installation?"; exit 1; }
[[ -d /var/www/nextcloud ]] || { echo "Nextcloud directory not found" ; exit 1; }
[[ -d "$DATADIR" ]] || { echo "Nextcloud data directory not found" ; exit 1; }
[[ "$(stat -fc%T "$BASEDIR")" == "btrfs" ]] && { echo "BTRFS not supported" ; exit 1; }
grep -q "btrfs" <(stat -fc%T "$BASEDIR") && { echo "BTRFS not supported" ; exit 1; }
# check version
####################

View File

@ -111,7 +111,7 @@ if [[ $( ls "$TMPDIR" | wc -l ) -eq $NUMFILES ]]; then
echo "restore datadir to $DATADIR..."
mkdir -p "$DATADIR"
[[ "$( stat -fc%T "$DATADIR" )" == "btrfs" ]] && which btrfs &>/dev/null && {
grep -q "btrfs" <(stat -fc%T "$DATADIR") && which btrfs &>/dev/null && {
rmdir "$DATADIR" || exit 1
btrfs subvolume create "$DATADIR" || exit 1
}

View File

@ -8,6 +8,8 @@ source /usr/local/etc/library.sh # sets NCLATESTVER PHPVER RELEASE
# all images
install_app nc-restore
# docker images only
[[ -f /.docker-image ]] && {
: