#!/bin/bash
mkdir -p /nfsexport /nfsmnt
cp /etc/exports{,.backup}
echo "/nfsexport *(rw,no_root_squash)" > /etc/exports
systemctl restart nfs-server
sleep 90
umount /nfsmnt
mount -t nfs -o vers=4.2 localhost:/nfsexport /nfsmnt || exit
cd /nfsmnt
cp /root/dio02.c .
cc dio02.c
tcpdump -U -s 9000 -i lo -w /root/dump.out.$$ port 2049 &
sleep 1
 ./a.out
sleep 1
kill -2 $!
cd
umount /nfsmnt
