测试ip连接
[root@master ~]# cat ip.sh
#!/bin/bash
master_name=`hostname`
echo $master_name
if [[ $master_name == 'master' ]];then
echo "hostname[master] set ok!"
else
echo "hostname[master] set fail! Current hostname is $master_name"
fi
master_ip=$(ifconfig -a|