19 lines
506 B
Bash
19 lines
506 B
Bash
#!/bin/sh
|
|
echo "Installing NFS server..."
|
|
apk add nfs-utils
|
|
|
|
# Make mount point directory for sharing
|
|
mkdir /mnt/shared
|
|
chmod 777 /mnt/shared
|
|
chown nobody:nobody /mnt/shared
|
|
|
|
# Mount /mnt/shared for all IPs, read-write, root users NOT allowed
|
|
# nohide: allows nested exports (doesnt hide a folder shared inside another shared folder)
|
|
cat << EOF > /etc/exports
|
|
/mnt/shared *(rw,nohide,sync,no_subtree_check,root_squash)
|
|
EOF
|
|
|
|
# Enable and start NFS server
|
|
exportfs -afv
|
|
rc-update add nfs
|
|
rc-service nfs start |