#!/bin/sh
# Short-Description: Automatically install DKMS modules for new kernels
# Description: A service to automatically install DKMS modules for new kernels.

test -f /usr/sbin/dkms || exit 0

if [ -f /lib/gentoo/functions.sh ]; then
	. /lib/gentoo/functions.sh
fi

if [ -n "$2" ]; then
	kernel="$2"
else
	kernel=`uname -r`
fi

# See how we were called.
case "$1" in
	start)
		dkms autoinstall --force --kernelver $kernel
		;;
	status)
		dkms status
		;;
	*)
		echo "Usage: $0 {start}"
esac

exit 0
