#!/bin/sh
ver=`/sbin/e-smith/db configuration getprop sysconfig ReleaseVersion | head -c 3`

case $ver in
    "6.0")
	/sbin/insmod /usr/lib/powerswitch60.o > /dev/null;;
    "5.6")
	/sbin/insmod /usr/lib/powerswitch56.o > /dev/null;;
    *)
	MAIL="Sorry, the powerswitch module was compiled for a different version"
	MAIL="$MAIL of the SME server. Please check http://contribs.org to see"
	MAIL="$MAIL if there is a version available for SME $ver.";
	echo $MAIL | mail -s "Warning: Failed to load the powerswitch module" admin
	;;
esac
