Back to home page

Redis cross reference

 
 

    


0001 
0002 case "$1" in
0003     start)
0004         if [ -f $PIDFILE ]
0005         then
0006                 echo "$PIDFILE exists, process is already running or crashed"
0007         else
0008                 echo "Starting Redis server..."
0009                 $EXEC $CONF
0010         fi
0011         ;;
0012     stop)
0013         if [ ! -f $PIDFILE ]
0014         then
0015                 echo "$PIDFILE does not exist, process is not running"
0016         else
0017                 PID=$(cat $PIDFILE)
0018                 echo "Stopping ..."
0019                 $CLIEXEC -p $REDISPORT shutdown
0020                 while [ -x /proc/${PID} ]
0021                 do
0022                     echo "Waiting for Redis to shutdown ..."
0023                     sleep 1
0024                 done
0025                 echo "Redis stopped"
0026         fi
0027         ;;
0028     *)
0029         echo "Please use start or stop as first argument"
0030         ;;
0031 esac