nfs客户端检测nfs服务端状态挂载脚本

#!/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

你可能感兴趣的:(nfs客户端检测nfs服务端状态挂载脚本)