#!/bin/sh PACKAGESROOT="/mnt/HD_a2/ROOT" # Set up needed directories and files if [ ! -d $PACKAGESROOT/var/lib/nfs ] then mkdir -p $PACKAGESROOT/var/lib/nfs fi if [ ! -d $PACKAGESROOT/etc ] then mkdir -p $PACKAGESROOT/etc fi if [ ! -f $PACKAGESROOT/etc/exports ] then cat > $PACKAGESROOT/etc/exports <<"EOF" /mnt/HD_a2 192.168.1.0/24(rw) /mnt/HD_a2/dati 192.168.1.0/24(rw) / 192.168.1.0/24(rw) EOF fi if [ ! -f $PACKAGESROOT/etc/hosts.allow ] then cat > $PACKAGESROOT/etc/hosts.allow <<"EOF" lockd: 192.168.1.* rquotad: 192.168.1.* mountd: 192.168.1.* statd: 192.168.1.* EOF cat > $PACKAGESROOT/etc/hosts.deny <<"EOF" lockd:ALL mountd:ALL rquotad:ALL statd:ALL EOF fi if [ ! -d /usr/sbin ] then mkdir -p /usr/sbin fi # Make symlinks ln -s $PACKAGESROOT/etc/exports /etc/ ln -s $PACKAGESROOT/var/lib /var/ ln -s $PACKAGESROOT/etc/hosts.* /etc/ ln -s $PACKAGESROOT/usr/sbin/* /usr/sbin/ # start the server insmod $PACKAGESROOT/var/modules/nfsd.o /usr/sbin/portmap sleep 1 /usr/sbin/rpc.mountd sleep 1 /usr/sbin/rpc.nfsd sleep 1 /usr/sbin/rpc.statd # re-export... $PACKAGESROOT/usr/sbin/exportfs -ra