#!/bin/sh # $Date: 2004/03/11 03:59:30 $ # $Revision: 1.1 $ # # # Choose here which drivers you'd like # to start at boot time. # config_scb="N" config_dcplus="N" config_bhs="Y" # # If you want babylon to dial automatically # on start up, set config_autodial to "Y" and # fill in the site name from your babylon.conf and # the phone number you wish to dial. # config_autodial="N" config_site="" config_phone="" case $1 in start) echo -n "Starting Babylon..." echo -n "BPE " /sbin/insmod babylon echo -n "daemon " @prefix@/sbin/babylond echo echo -n "Loading Babylon drivers..." if [ "$config_scb" = "Y" ] ; then /sbin/insmod scb >/dev/null 2>&1 fi if [ "$config_dcplus" = "Y" ] ; then /sbin/insmod dcplus >/dev/null 2>&1 fi if [ "$config_bhs" = "Y" ] ; then if [ -d /etc/babylon ] ; then bhs_list=`ls /etc/babylon/bhs*.conf` fi bhs_types="" bhs_protos="" for i in $bhs_list ; do tmp1=$bhs_types tmp2=`cat $i | grep -i CARDTYPE | cut -f2 -d"="` tmp3=$bhs_protos tmp4=`cat $i | grep -i CARDPROTO | cut -f2 -d"="` if [ -z "$tmp1" ] ; then bhs_types=$tmp2 bhs_protos=$tmp4 else bhs_types=$tmp1,$tmp2 bhs_protos=$tmp3,$tmp4 fi done /sbin/insmod babhisax >/dev/null 2>&1 /sbin/insmod hisax no_reset=1 type=$bhs_types protocol=$bhs_protos >/dev/null 2>&1 j=0 for i in $bhs_list ; 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 fi echo "Babylond Rescanning Channels..." @prefix@/sbin/bchan rescan echo "done." if [ "$config_autodial" = "Y" ] ; then ( sleep 10; while ! /usr/sbin/bdial $config_site $config_phone > /dev/null 2>&1 ; do sleep 5 ; done ) & fi touch /var/lock/subsys/babylon ;; stop) echo -n "Stopping Babylon..." echo -n "daemon " killall bdial >/dev/null 2>&1 killall babylond >/dev/null 2>&1 sleep 1 if [ "$config_scb" = "Y" ] ; then /sbin/rmmod scb >/dev/null 2>&1 fi if [ "$config_dcplus" = "Y" ] ; then /sbin/rmmod dcplus >/dev/null 2>&1 fi if [ "$config_bhs" = "Y" ] ; then /sbin/rmmod hisax /sbin/rmmod babhisax >/dev/null 2>&1 fi echo -n "BPE " /sbin/rmmod babylon echo rm -f /var/lock/subsys/babylon ;; *) echo "Usage: babylon.init {start|stop}" exit 1 ;; esac exit 0