#!/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
	    tout=0
	    while [ $tout -le 10 ] ; do
		test -e /dev/capi/31 && break;
		sleep 1
		tout=$(($tout + 1))
	    done
	else
	    /sbin/modprobe -r kernelcapi
	    LOAD_CAPI=""
	fi
    fi
fi
