nfs-install.sh 368 B

123456789101112
  1. apt-get udpate
  2. apt-get remove nfs-kernel-server
  3. apt-get install nfs-kernel-server
  4. read -p "ip range(such as 192.168.31.0/24): " input;
  5. iprange=`echo $input | tr '[A-Z]' '[a-z]'`;
  6. mkdir /data/nfs-data
  7. chown nobody:nogroup /data/nfs-data
  8. echo "/data/nfs-data $iprange(rw,sync,no_subtree_check,no_root_squash)" >> /etc/exports
  9. sudo systemctl restart nfs-kernel-server