#!/bin/bash
if [ -z "$LOAD_CAPI" ]; then
    LOAD_CAPI="yes"
    echo -n " kcapi"
    /sbin/modprobe kernelcapi >& /dev/null
    RET=$?
    if [ $RET -eq 0 ]; then
	echo -n " capi"
	/sbin/modprobe capi >& /dev/null
	RET=$?
	if [ $RET -eq 0 ]; then
	    echo -n " capidrv"
	    /sbin/modprobe capidrv >& /dev/null
	    RET=$?
	    if [ $RET != 0 ]; then
		/sbin/modprobe -r capi
		/sbin/modprobe -r kernelcapi
		LOAD_CAPI=""
	    fi
	else
	    /sbin/modprobe -r kernelcapi
	    LOAD_CAPI=""
	fi
    fi
fi
