Server IP : 192.158.238.246 / Your IP : 216.73.216.89 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/cpanel/ea-php80/root/usr/share/tests/pecl/redis/tests/ |
Upload File : |
#!/bin/bash PORTS="6379 6380 6381 6382" REDIS=redis-server function start_node() { P=$1 echo "starting node on port $P"; CONFIG_FILE=`tempfile` cat > $CONFIG_FILE << CONFIG port $P CONFIG $REDIS $CONFIG_FILE > /dev/null 2>/dev/null & sleep 1 rm -f $CONFIG_FILE } function stop_node() { P=$1 PID=$2 redis-cli -h localhost -p $P shutdown kill -9 $PID 2>/dev/null } function stop() { for P in $PORTS; do PID=`lsof -i :$P | tail -1 | cut -f 2 -d " "` if [ "$PID" != "" ]; then stop_node $P $PID fi done } function start() { for P in $PORTS; do start_node $P done } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; *) echo "Usage: $0 [start|stop|restart]" ;; esac