start() { mkdir -p /var/lib/nfs if ! [ -d /var/lib/nfs ]; then echo "ERROR: failed to create data folder." return 1 fi /usr/bin/rpcbind if [ $? -ne 0 ]; then echo "ERROR: failed to start rpcbind." return 1 fi /usr/bin/rpc.statd if [ $? -ne 0 ]; then echo "ERROR: failed to start rpc.statd." return 1 fi /usr/bin/rpc.nfsd if [ $? -ne 0 ]; then echo "ERROR: failed to start rpc.nfsd." return 1 fi /usr/bin/exportfs -ra if [ $? -ne 0 ]; then echo "ERROR: failed to create filesystem table." return 1 fi /usr/bin/rpc.mountd if [ $? -ne 0 ]; then echo "ERROR: failed to start rpc.mountd." return 1 fi /usr/bin/exportfs -ra if [ $? -ne 0 ]; then echo "ERROR: failed to export filesystems." return 1 fi } stop() { killall rpc.mountd killall rpc.statd killall rpcbind }