#!/bin/bash
#作者:罗红江
#QQ:123769752
#mail:g_linux@qq.com
#原创---请你转载说明出处,请支持别人的劳动成果。
declare -i count sum mf
sum=0
IP="
*.0.69.15
*.0.69.22
*.0.69.23
*.0.68.22
" #改成你自己的
clear
echo -e "\E[23;33m"
echo "=================================start ..============================= "
echo -e "\E[0m"
for i in ${IP[*]}
do
count=$count+1
remoteIP=root@$i
ping -t 3ms -c 1 $i 2>&1>/dev/null
if (( $?>0 ));then
echo -e "$remoteIP connect fail! <<==========================================\n"
continue
else
echo -e "$remoteIP proc >>>>>>\n"
echo -e "++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
ssh $remoteIP $@
echo -e "++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
sum=$sum+1
fi
done
mf=$count-$sum
echo -e "machine:$count--make success:$sum,make fail:$mf"
echo -e "\E[23;33m"
echo "================================END ..============================= "
echo -e "\E[0m"
阅读(918) | 评论(0) | 转发(0) |