#!/usr/bin/env bash # Memcached Installer # Min. Requirement : GNU/Linux Ubuntu 14.04 & 16.04 # Last Build : 17/07/2019 # Author : ESLabs.ID (eslabs.id@gmail.com) # Since Version : 1.0.0 # Include helper functions. if [ "$(type -t run)" != "function" ]; then BASEDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd ) # shellchechk source=scripts/helper.sh # shellcheck disable=SC1090 . "${BASEDIR}/helper.sh" fi # Make sure only root can run this installer script. requires_root function enable_memcache { # PHP version. local PHPv="${1}" if [ -z "${PHPv}" ]; then PHPv=${PHP_VERSION:-"7.3"} fi if "${DRYRUN}"; then echo "Optimizing PHP Memcache module in dryrun mode." else # Custom Memcache setting. #sed -i 's/-m 64/-m 128/g' /etc/memcached.conf if [ -d "/etc/php/${PHPv}/mods-available/" ]; then cat >> "/etc/php/${PHPv}/mods-available/memcache.ini" <