#!/bin/bash toolName=redis toolDeps=redis-server # Get script working directory # (when called from a different directory) WDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >>/dev/null 2>&1 && pwd)" CONFIG=0 SCRIPT_NAME=$(basename -- $0) SCRIPT_NAME=${SCRIPT_NAME%%.*} CONFIG_FILE_NAME="${SCRIPT_NAME}.cfg" CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example" seq_config() { initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE" if [ $? -eq 0 ] ; then CONFIG=1 fi } step_1_info() { echo "Install $toolName"; } step_1_alias() { echo "install"; } step_1() { local aptOpt= if quiet;then aptOpt="-y" fi exe apt update exe apt install $toolDeps $aptOpt } step_2_info() { echo "Installation notes"; } step_2_alias() { echo "notes"; } step_2() { cat < '\\OC\\Memcache\\Redis', 'memcache.distributed' => '\\OC\\Memcache\\Redis', 'redis' => array ( 'host' => '/var/run/redis/redis-server.sock', 'port' => 0, 'password' => 'verystrongpassword', 'timeout' => 0.0, ), NOTES_EOF } step_10_info() { echo "Execute redis-cli commands" echoinfo " [CLI COMMAND]" echoinfo " e.g. info" } step_10_options() { echo "[CLI COMMAND]"; } step_10_alias() { echo "cli"; } step_10() { shift local cliCmd="$@" if [ ! -z "$REDIS_AUTH" ] ; then #exe "echo -e \"AUTH=$REDIS_AUTH$cliCmd\" | redis-cli" exe redis-cli -a "$REDIS_AUTH" $cliCmd else exe redis-cli $cliCmd fi } readonly sqr_minVersion=16 . /usr/local/bin/sequencer.sh