[root@master server]# cat allupdate_agent.sh
username="root"
passwd="Oet01279"
port="22"
timeout=5
cmd="cd /home/wgcloud/agent-linux-amd64-v3.4.4&&wget --no-check-certificate http://192.168.0.13:9090/wgcloud/resources/updateAgentToNew.sh; bash updateAgentToNew.sh http://192.168.0.13:9090"
for host in `cat ip_config`
do
result=""
result=`sshpass -p "$passwd" ssh -p $port -o StrictHostKeyChecking=no -o ConnectTimeout=$timeout $username@$host $cmd`
echo $host >> result.txt
echo $result >> result.txt
done
echo "success update agent"
标签:版本升级,agent,echo,host,sh,result,wgcloud From: https://www.cnblogs.com/vzhangxk/p/17295567.html