#!/bin/bash
pwd_path_0="/home/qa-deploy-utils"
pwd_path="/home/qa-deploy-utils/qa_shell_script"
config_server="$pwd_path/config_server"
project_path=`cat $config_server/get_env_ip.sh`




for ip_last_num in $project_path
    do
			IP_host=`sh $pwd_path_0/get-ip.sh $ip_last_num`
	if [[ "$ip_last_num" == "50" ]]; then
		echo " not in 50 "
	else
		echo "------------------IP-${IP_host}------------------"
        	expect -c "
                	set timeout 10
                	spawn ssh root@${IP_host}
                	expect \"]#\"
                	send \"sh /home/qa-deploy-utils/qa_shell_script/$1\r\"
                	set timeout -1
                    	expect \"]#\"
                    	send \"exit\r\"
             	expect eof;"
		echo "======================END================================="
	fi
done
