#!/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
	    typeset -i tout=0
	    while ((tout++ < 400)) ; do
		test -e /dev/capi/31 && break;
		usleep 25000
	    done
	else
	    /sbin/modprobe -r kernelcapi
	    LOAD_CAPI=""
	fi
    fi
fi
