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>2018-09-10 06:23:10 +0300
committernacho <nacho@ownyourbits.com>2018-09-13 03:54:15 +0300
commited96a0c5d81bddd211ba2f3f0a8055d1955cdb3b (patch)
tree2b52cfbd94b74ef25c2df15f4f3d52c988f909b4
parentee370f1bbb947714272e06d3ffe5e61cabab8a97 (diff)
nc-limits: fix error when specifying unitsv0.59.5
-rw-r--r--etc/ncp-config.d/nc-limits.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/etc/ncp-config.d/nc-limits.sh b/etc/ncp-config.d/nc-limits.sh
index 706d0131..40f7a3ad 100644
--- a/etc/ncp-config.d/nc-limits.sh
+++ b/etc/ncp-config.d/nc-limits.sh
@@ -30,7 +30,7 @@ configure()
# MAX PHP MEMORY
local CONF=/var/www/nextcloud/.user.ini
local CURRENT_PHP_MEM="$( grep "^memory_limit" "$CONF" | sed 's|.*=||' )"
- [[ $MEMORYLIMIT_ -eq 0 ]] && MEMORYLIMIT_=$AUTOMEM && echo "Using ${AUTOMEM}B for PHP"
+ [[ "$MEMORYLIMIT_" == "0" ]] && MEMORYLIMIT_=$AUTOMEM && echo "Using ${AUTOMEM}B for PHP"
sed -i "s/post_max_size=.*/post_max_size=$MAXFILESIZE_/" "$CONF"
sed -i "s/upload_max_filesize=.*/upload_max_filesize=$MAXFILESIZE_/" "$CONF"
sed -i "s/memory_limit=.*/memory_limit=$MEMORYLIMIT_/" "$CONF"
@@ -38,14 +38,13 @@ configure()
# MAX PHP THREADS
local CONF=/etc/php/7.0/fpm/pool.d/www.conf
local CURRENT_THREADS=$( grep "^pm.max_children" "$CONF" | awk '{ print $3 }' )
- local PHPTHREADS=0
- [[ $PHPTHREADS_ -eq 0 ]] && PHPTHREADS_=$( nproc ) && echo "Using $PHPTHREADS_ PHP threads"
+ [[ "$PHPTHREADS_" == "0" ]] && PHPTHREADS_=$( nproc ) && echo "Using $PHPTHREADS_ PHP threads"
sed -i "s|pm.max_children =.*|pm.max_children = $PHPTHREADS_|" "$CONF"
sed -i "s|pm.max_spare_servers =.*|pm.max_spare_servers = $PHPTHREADS_|" "$CONF"
sed -i "s|pm.start_servers =.*|pm.start_servers = $PHPTHREADS_|" "$CONF"
# RESTART PHP
- [[ $PHPTHREADS -ne $CURRENT_THREADS ]] || \
+ [[ "$PHPTHREADS_" != "$CURRENT_THREADS" ]] || \
[[ "$MEMORYLIMIT" != "$CURRENT_PHP_MEM" ]] || \
[[ "$MAXFILESIZE_" != "$CURRENT_FILE_SIZE" ]] && {
bash -c " sleep 3
@@ -60,7 +59,7 @@ configure()
# redis max memory
local CONF=/etc/redis/redis.conf
local CURRENT_REDIS_MEM=$( grep "^maxmemory" "$CONF" | awk '{ print $2 }' )
- [[ $REDISMEM_ -eq 0 ]] && REDISMEM_=$AUTOMEM && echo "Using ${AUTOMEM}B for Redis"
+ [[ "$REDISMEM_" == "0" ]] && REDISMEM_=$AUTOMEM && echo "Using ${AUTOMEM}B for Redis"
[[ "$REDISMEM_" != "$CURRENT_REDIS_MEM" ]] && {
sed -i "s|maxmemory .*|maxmemory $REDISMEM_|" "$CONF"
service redis restart