nfs-server.sh 639 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. yum install nfs-utils
  3. mkdir /nextcloud
  4. mkdir /nextcloud/data
  5. mkdir /nextcloud/web
  6. chmod -R 755 /nextcloud/data
  7. chmod -R 755 /nextcloud/web
  8. chown 48:48 /nextcloud/data
  9. chown 48:48 /nextcloud/web
  10. systemctl enable rpcbind
  11. systemctl enable nfs-server
  12. systemctl enable nfs-lock
  13. systemctl enable nfs-idmap
  14. systemctl start rpcbind
  15. systemctl start nfs-server
  16. systemctl start nfs-lock
  17. systemctl start nfs-idmap
  18. cat > /etc/exports <<EOD
  19. /nextcloud/web 192.168.56.0/255.255.255.0(rw,sync,no_root_squash,no_all_squash)
  20. /nextcloud/data 192.168.56.0/255.255.255.0(rw,sync,no_root_squash,no_all_squash)
  21. EOD
  22. systemctl restart nfs-server