Files
alpine-server-setup/services/nfs/install.sh
Maurice 7edf0a8c3d Update
2025-10-03 12:11:49 +02:00

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