feat(nfs): add initial NFS server implementation with configuration and usage instructions

This commit is contained in:
2026-03-29 13:40:09 +02:00
parent 330a3348b9
commit 0778d7a6fa
6 changed files with 75 additions and 0 deletions

22
nfs/run.sh Normal file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bashio
# Read config
NETWORK=$(bashio::config 'allowed_network')
# Setup exports
bashio::log.info "Exporting /media folder to ${NETWORK}..."
echo "/media ${NETWORK}(rw,sync,no_subtree_check,no_root_squash)" > /etc/exports
cat /etc/exports
# Start NFS services
bashio::log.info "Starting NFS services..."
rpcbind
exportfs -ra
# Start rpc.statd for file locking
rpc.statd &
# Start the NFS server kernel threads
rpc.nfsd
# Start rpc.mountd in the foreground to keep the container running
exec rpc.mountd --no-udp -F