#/bin/bash
_IP1=$1
_IP2=$2
_COMMAND=$3
if [ -f /tmp/whitefox.tmp.ip ]
then
rm -rf /tmp/whitefox.tmp.ip
fi;
echo $_IP1 >> /tmp/whitefox.tmp.ip
echo $_IP2 >> /tmp/whitefox.tmp.ip
_IP3=$(awk -F "." '{ print $1 "." $2 "." $3 }' /tmp/whitefox.tmp.ip |sed 1d )
i=$(awk -F "." '{ print $4 }' /tmp/whitefox.tmp.ip|sed 2d)
n=$(awk -F "." '{ print $4 }' /tmp/whitefox.tmp.ip|sed 1d)
for x in `seq $i $n `;do ssh $_IP3.$x " $_COMMAND ";done
rm -rf /tmp/whitefox.tmp.ip
阅读(682) | 评论(0) | 转发(0) |