#!/bin/bash
ip=$1
port=$2
#连接服务
function clear_redis(){
 expect -c "
                 set timeout 10
           spawn ssh root@${ip}
                 expect \"]#\"
                 send \"cd /home/qa-deploy-utils/qa_shell_script/redis_script\r\"
                 expect \"]#\"
                 send \"sh flush_all.sh $port\r\"
                 set timeout -1
           expect \"]#\"
           send \"exit\r\"
        expect eof;"
}

clear_redis 
