#!/usr/bin/sh #---------------------------------------------------------------------------------------- # /var/install/bin/redis-start-client - start Redis client program # # Copyright (c) 2015-2024 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2015-10-31 jed # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------------------- # read eislib . /var/install/include/eislib redisport=6379 configfile=/etc/config.d/redis client_bin=/usr/bin/redis-cli redispass='' if [ -f ${configfile} ] then redispass=`grep "REDIS_DB_PASS" ${configfile} | tr \'\" '|' | sed 's/^REDIS_DB_PASS=.*|\([^|]*\)|.*/\1/'` fi act_pmode=`get_printmode` # check if screensize handling is available if [ -n "${_EISLIB_SCREENSIZE_Y}" ] then if check_screensize then # # define maxrownum = _EISLIB_SCREENSIZE # - 3 Header Lines # - 1 Footer Lines # ask line maxcolnum=`expr ${_EISLIB_SCREENSIZE_X} - 1` maxrownum=`expr ${_EISLIB_SCREENSIZE_Y} - 4` true else mecho --info "Return to calling script" exit 1 fi else # default if screensize handling is not available maxcolnum=79 maxrownum=18 fi maxcolnum=60 seperator=`printf '%*s\n' ${maxcolnum} "" | tr ' ' '-'` clrhome mecho --info "Redis Client Interface" echo mecho -n "enter '" mecho -n --info "quit" echo "' to exit program." echo # -h Server hostname (default: 127.0.0.1). # -p Server port (default: 6379) if [ -n "${redispass}" ] then # the redis-cli command line program prints out # a warning, if the authentication password is # provided on the command line. # # From Redis 5.0.3 onwards a new command line # switch '--no-auth-warning' will be available # to suppress this message. # ${client_bin} -p ${redisport} -a ${redispass} 2>/dev/null else ${client_bin} -p ${redisport} fi exit 0