nfs故障後,客戶端使用df命令沒法退出解決,用於腳本方案

使用read超時參數便可解決:html

ex:shell

read -t5 DIR < <(df)
if [ -n "$DIR" ];then
        echo $DIR
else
        echo "read error"
fi


感謝谷歌,方法出自:http://dbaspot.com/shell/404467-check-nfs-mount-script.htmlbash

相關文章
相關標籤/搜索