nfs客户端检测nfs服务端状态挂载脚本
2018-12-25 本文已影响19人
think_lonely
#!/bin/bash
while [ 1 = 1 ]
do
count=`showmount -e 10.32.1.123| grep data|wc -l`
if [ $count -ne 1 ]
then
echo "guanzai"
mount -t nfs 10.32.1.123:/data /data -o proto=tcp -o nolock
if [ `df | grep 10.32.1.123:/data | wc -l` = 1 ]
then
echo "gua zai cheng gong "
break
fi
else
echo "nfs server not ok"
fi
sleep 5
done