if EGW_APC_SHM_SIZE is set in environment, propagate value to apcu.ini

This commit is contained in:
Ralf Becker 2020-02-10 14:32:27 +01:00
parent e73db868d2
commit bc1ae1cbaa

View File

@ -1,8 +1,16 @@
#!/bin/bash
set -e
# if EGW_APC_SHM_SIZE is set in environment, propagate value to apcu.ini
test -n "$EGW_APC_SHM_SIZE" && {
grep "apc.shm_size" /etc/php/7.3/fpm/conf.d/20-apcu.ini >/dev/null && \
sed -e "s/^;\?apc.shm_size.*/apc.shm_size=$EGW_APC_SHM_SIZE/g" \
-i /etc/php/7.3/fpm/conf.d/20-apcu.ini || \
echo "apc.shm_size=$EGW_APC_SHM_SIZE" >> /etc/php/7.3/fpm/conf.d/20-apcu.ini \
}
# if EGW_SESSION_TIMEOUT is set in environment, propagate value to php.ini
test -n "$EGW_SESSION_TIMEOUT" && test "$EGW_SESSION_TIMEOUT" -ge 1440 &&
test -n "$EGW_SESSION_TIMEOUT" && test "$EGW_SESSION_TIMEOUT" -ge 1440 && \
sed -e "s/^;\?session.gc_maxlifetime.*/session.gc_maxlifetime=$EGW_SESSION_TIMEOUT/g" \
-i /etc/php/7.3/fpm/php.ini