#!/bin/sh
# DF-3255 — one-time loopback NFS setup on the DragonFly guest (root).
set -x
mkdir -p /mnt/nfspoc
grep -q '^/tmp' /etc/exports 2>/dev/null || echo '/tmp -maproot=root' >> /etc/exports
pgrep -x rpcbind >/dev/null || rpcbind
sleep 1
pgrep -x mountd >/dev/null || mountd
sleep 1
pgrep -x nfsd >/dev/null || nfsd -t -u -n 4
sleep 2
mount -t nfs -o tcp 127.0.0.1:/tmp /mnt/nfspoc
mount | grep nfspoc
