web01

#!/bin/bach
#name:dengxi
#time:2018-06-18
#QQ-mile:[email protected]
#"nfs 客户端挂载"

nfs=`rpm -qa rpcbind nfs-utils|wc -l`
if [ $nfs -eq 0 ]
then
    yum install -y rpcbind nfs-utils
elif [ $nfs -ne 0 ]
then
    echo '/data 172.16.1.0/24(rw,sync)' >/etc/exports
else
    exit 1
fi

/etc/init.d/rpcbind start || mkdir /video -p

mou=`grep nfs /etc/fstab |wc -l`
if [ $mou -eq 0 ]
then
    mount  -t nfs 172.16.1.31:/data /video
elif [ $mou -gt 0 ]
    exit 1
fi

chkconfig netfs on

猜你喜欢

转载自www.cnblogs.com/youqudedaima/p/9201214.html