#!/bin/sh # Copyright (C) 1997-2000 SpellCaster Telecommunications Inc. # $Id: bhs.init.in,v 1.1 2004/03/11 03:59:30 bcrl Exp $ # Released under the GNU Public License. See LICENSE file for details. if [ -d /etc/babylon ] ; then bhsconf=`ls /etc/babylon/bhs*.conf` fi echo "bhsconf: $bhsconf" bhstypes="" bhsprotos="" for i in $bhsconf ; do tmp1=$bhstypes tmp2=`cat $i | grep -i CARDTYPE | cut -f2 -d"="` tmp3=$bhsprotos tmp4=`cat $i | grep -i CARDPROTO | cut -f2 -d"="` if [ -z "$tmp1" ] ; then bhstypes=$tmp2 bhsprotos=$tmp4 else bhstypes=$tmp1,$tmp2 bhsprotos=$tmp3,$tmp4 fi done case $1 in start) echo -n "Loading bhs..." /sbin/insmod babhisax /sbin/insmod hisax type=$bhstypes protocol=$bhsprotos j=0 for i in $bhsconf ; do . $i /sbin/bhsctrl -d$j -c0 -s$SPID0 /sbin/bhsctrl -d$j -c0 -n$DN0 /sbin/bhsctrl -d$j -c1 -s$SPID1 /sbin/bhsctrl -d$j -c1 -n$DN1 j=$[j+1] done echo -n " rescanning channels..." @prefix@/sbin/bchan rescan echo "done." touch /var/lock/subsys/bhs ;; stop) echo -n "Unloading bhs..." /sbin/rmmod hisax /sbin/rmmod babhisax echo "done." rm -f /var/lock/subsys/bhs ;; *) echo "Usage: bhs.init {start|stop}" exit 1 ;; esac exit 0