#!/bin/sh

##adjust /usr/src/linux link if we are pretty sure we won't screw up the system
KV=$(uname -r)
if [ -d /usr/src/linux-${KV} ] && $(qfile /usr/src/linux-${KV} 2>&1 > /dev/null)
then
	if [ -L /usr/src/linux ]
	then
		unlink /usr/src/linux
	fi
	ln -s /usr/src/linux-${KV} /usr/src/linux

	if [ -L /lib/modules/${KV}/build ]
	then
		unlink /lib/modules/${KV}/build
	fi
	ln -s /usr/src/linux-${KV} /lib/modules/${KV}/build

	if [ -L /lib/modules/${KV}/source ]
	then
		unlink /lib/modules/${KV}/source
	fi
	ln -s /usr/src/linux-${KV} /lib/modules/${KV}/source
fi
