#!/bin/sh
#
# Script to check the header versions against the version of the running
# kernel...and complain if need be
# Copyright (C) 1997-2000 SpellCaster Telecommunications
# $Id: check-hdrs,v 1.2 2001/06/18 16:43:24 mdj Exp $
# Released under the GNU Public License. See LICENSE file for details.
#

if [ -f /usr/src/linux/include/linux/compile.h ]
then
	gcc -o mkver mkver.c
	if [ ! -f mkver ]
	then
		exit 1
	fi
	./mkver >kver
	diff kver /proc/version >/dev/null 2>&1
	ERR=$?
	typeset -i ERR
	rm -f mkver kver
	if [ $ERR -ne 0 ]
	then
		echo "************************************************"
		echo "Kernel headers do not match the running kernel"
		echo "Please (re)compile and install the kernel for"
		echo "this system otherwise you risk running with"
		echo "mismatched kernel header information."
		echo "************************************************"
		# exit 1
		exit 0
	fi
	echo "************************************************"
	echo " Kernel version matches kernel headers"
	echo "************************************************"
else
	echo "***********************************************"
	echo " WARNING: UNABLE TO VERIFY KERNEL VERSION "
	echo "***********************************************"
fi
exit 0
