#!/bin/sh
if [ ! -d netinet ]; then
KERNEL_DIR=/usr/src/linux
echo "Do you have the Linux kernel source available ??"
read answer
if [ $answer ]; then
if [ $answer = "y" -o $answer = "Y" -o $answer = "yes" -o $answer = "Yes" ]; then

	if [ ! -d netinet ]; then mkdir netinet; fi
	FILES="ip.h dev.h eth.h"
	for file in $FILES; do
		if [ -f ${KERNEL_DIR}/net/tcp/$file ]; then
			cp ${KERNEL_DIR}/net/tcp/$file netinet
		else
			echo "I cannot read ${KERNEL_DIR}/net/tcp/$file"
			exit 1
		fi
	done
	touch netinet/in_systm.h

else
	echo "Ok I'm using old kernel files!!"
	echo "This may become incompatible eventually."
	echo "Please obtain the kernel source and replace the new .h files"
	echo "in the subdirectory netinet under here."
	if [ -d support/netinet. ]; then mv support/netinet. netinet;
	else echo "I cannot find the dir support/netinet." ;exit 1; fi
fi
else
echo Whoops, You must answer y or n !!
echo Try again
exit 1
fi
fi
exit 0
