diff options
author | Daniel Hansson <github@hanssonit.se> | 2019-02-19 23:24:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-19 23:24:46 +0300 |
commit | 512ecaa6ce40de2db1a0d43537cb6022d6473445 (patch) | |
tree | db103dbf4b5cf54e8f1a1d0b82c011cc9e59fe8a /nextcloud_update.sh | |
parent | 3bd2892dae01dc867be74e5ba8e9911f7838ed70 (diff) |
check if redis.so is enabled (#787)
Diffstat (limited to 'nextcloud_update.sh')
-rw-r--r-- | nextcloud_update.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/nextcloud_update.sh b/nextcloud_update.sh index ba1d9dd5..9cb76829 100644 --- a/nextcloud_update.sh +++ b/nextcloud_update.sh @@ -78,6 +78,20 @@ then pecl channel-update pecl.php.net yes no | pecl install redis service redis-server restart + # Check if redis.so is enabled + # PHP 7.0 apache + if [ -f /etc/php/7.0/apache2/php.ini ] + then + ! [[ "$(grep -R extension=redis.so /etc/php/7.0/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/7.0/apache2/php.ini + # PHP 7.2 apache + elif [ -f /etc/php/7.2/apache2/php.ini ] + then + ! [[ "$(grep -R extension=redis.so /etc/php/7.2/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/7.2/apache2/php.ini + # PHP 7.2 fpm + elif [ -f "$PHP_INI" ] + then + ! [[ "$(grep -R extension=redis.so "$PHP_INI")" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> "$PHP_INI" + fi restart_webserver elif pecl list | grep redis >/dev/null 2>&1 then @@ -90,6 +104,20 @@ then pecl channel-update pecl.php.net yes no | pecl upgrade redis service redis-server restart + # Check if redis.so is enabled + # PHP 7.0 apache + if [ -f /etc/php/7.0/apache2/php.ini ] + then + ! [[ "$(grep -R extension=redis.so /etc/php/7.0/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/7.0/apache2/php.ini + # PHP 7.2 apache + elif [ -f /etc/php/7.2/apache2/php.ini ] + then + ! [[ "$(grep -R extension=redis.so /etc/php/7.2/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/7.2/apache2/php.ini + # PHP 7.2 fpm + elif [ -f "$PHP_INI" ] + then + ! [[ "$(grep -R extension=redis.so "$PHP_INI")" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> "$PHP_INI" + fi restart_webserver fi |