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-08-31 09:45:56 +0300
committernachoparker <nacho@ownyourbits.com>2017-09-02 00:32:16 +0300
commit009c82e6cfb82cc40c49a9e253fe41bbbf779b13 (patch)
tree8213b20f68cfbe2941013eef540ec95a379bfb02 /etc/nextcloudpi-config.d/nc-database.sh
parentcfc759969a9f0afdde35689e7185d49533e6c78f (diff)
shellcheck style fixesv0.24.12
Diffstat (limited to 'etc/nextcloudpi-config.d/nc-database.sh')
-rw-r--r--etc/nextcloudpi-config.d/nc-database.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/etc/nextcloudpi-config.d/nc-database.sh b/etc/nextcloudpi-config.d/nc-database.sh
index 4b5d6c7c..b1651f13 100644
--- a/etc/nextcloudpi-config.d/nc-database.sh
+++ b/etc/nextcloudpi-config.d/nc-database.sh
@@ -35,8 +35,8 @@ or the database will fail.
configure()
{
- local SRCDIR=$( grep datadir /etc/mysql/mariadb.conf.d/50-server.cnf | cut -d= -f2 )
- [ -d $SRCDIR ] || { echo -e "database directory $SRCDIR not found"; return 1; }
+ local SRCDIR=$( grep datadir /etc/mysql/mariadb.conf.d/50-server.cnf | awk -F "= " '{ print $2 }' )
+ [ -d "$SRCDIR" ] || { echo -e "database directory $SRCDIR not found"; return 1; }
[ -d "$DBDIR_" ] && {
[[ $( find "$DBDIR_" -maxdepth 0 -empty | wc -l ) == 0 ]] && {
@@ -49,11 +49,11 @@ configure()
local BASEDIR=$( dirname "$DBDIR_" )
mkdir -p "$BASEDIR"
- grep -q ext <( stat -fc%T $BASEDIR ) || { echo -e "Only ext filesystems can hold the database"; return 1; }
+ grep -q ext <( stat -fc%T "$BASEDIR" ) || { echo -e "Only ext filesystems can hold the database"; return 1; }
- sudo -u mysql test -x $BASEDIR || { echo -e "ERROR: the user mysql does not have access permissions over $BASEDIR"; return 1; }
+ sudo -u mysql test -x "$BASEDIR" || { echo -e "ERROR: the user mysql does not have access permissions over $BASEDIR"; return 1; }
- [[ $( stat -fc%d / ) == $( stat -fc%d $BASEDIR ) ]] && \
+ [[ $( 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"
cd /var/www/nextcloud
@@ -61,7 +61,7 @@ configure()
echo "moving database to $DBDIR_..."
service mysql stop
- mv $SRCDIR "$DBDIR_" && \
+ mv "$SRCDIR" "$DBDIR_" && \
sed -i "s|^datadir.*|datadir = $DBDIR_|" /etc/mysql/mariadb.conf.d/50-server.cnf
service mysql start