#!/bin/sh # # /etc/init.d/isdn-hw.init # # ISDN Hardware Initialisation # # Copyright 1997 Peter Bieringer # # # Version: 2.01 15.11.97 # # Changes since 14.08.97: Add pnp test for DLD 5.2 # # Return Values: 0=ok 1=Nothing to do 2=Error occurs #set -x # stamp file to show that isapnp cards where configured previous PNPSTAMP=/var/run/isapnp-configured # Source function library. if [ -f /etc/init.d/functions ]; then . /etc/init.d/functions else echo "Functions File Not Found!" exit 2 fi # Source ISDN-Hardware Information if [ -f /etc/sysconfig/isdn-hw ] ; then . /etc/sysconfig/isdn-hw else echo "ISDN-Hardware Information File Not Found!" exit 2 fi # Check that ISDN Hardware is up [ "$ISDNHW" = "yes" -o "$ISDNHW" = "YES" ] || exit 1 # Get Kernel Version for module loading VERSION=`cat /proc/version | awk '{ print $3 }' ` SYSPATH="/sbin" case "$1" in start) echo "Initialisiere ISDN Hardware." # Already done? Look at the flag if [ -f /var/lock/subsys/isdn-hw ]; then echo -e "\aAlready Done!" exit 1 fi # PnP-Configuration of ISDN-Card if [ "$ISDNHWPNP" = "yes" -o "$ISDNHWPNP" = "YES" ]; then echo "Init PnP Information for ISDN Card" # Already done? Look at the flag if [ -f /var/lock/subsys/isdn-hw-pnp -o -f $PNPSTAMP ]; then echo -e "\aAlready done!" else # PnP Binary exists? if ! [ -f $ISAPNPBIN ]; then echo "ISA-PnP Binary Missing" exit 2 fi # Do PnP Configure $ISAPNPBIN $ISDNHWPNPCONFIG || (echo "Error At ISA-PnP!"; exit 2) # Done, set flag touch /var/lock/subsys/isdn-hw-pnp fi fi # load VJ-compression module # if VJ compression is compiled into kernel .. you can omit this echo "Load 'VJ-compression' Module" $SYSPATH/insmod /lib/modules/$VERSION/net/slhc.o # load isdn4linux driver # if isdn4linux is compiled into kernel -> comment following lines out echo "Load 'isdn4linux' Module" $SYSPATH/insmod /lib/modules/$VERSION/misc/isdn.o # load isdn hardware driver # if this module is compiled into kernel -> comment following lines out echo "Load ISDN Hardware '$ISDNHWMOD' Module" $SYSPATH/insmod /lib/modules/$VERSION/misc/$ISDNHWMOD.o $ISDNHWMODCONFIG # configure ISDN Device for logging echo "ISDN Control Debug On For Logging" $ISDNHWCTRLBIN $ISDNHWNAME 1 4 if [ -x $ISDNLOGBIN ]; then #$ISDNLOGBIN -t2 -vw2 -m1015 /dev/isdnctrl 2> /var/log/isdnlog & $ISDNLOGBIN -t2 -vw2 /dev/isdnctrl 2> /var/log/isdnlog & fi # All done, Set flag touch /var/lock/subsys/isdn-hw echo "Done!" ;; stop) echo "Stoppe ISDN Hardware." # Already done? Look at the flag if ! [ -f /var/lock/subsys/isdn-hw ]; then echo -e "\aAlready Done!" exit 1 fi # unload isdnlog echo -n "Stop ISDNlog " killproc isdnlog echo # unload ISDN hardware driver echo "Unload ISDN Hardware '$ISDNHWMOD' Module" $SYSPATH/rmmod $ISDNHWMOD # unload isdn4linux driver echo "Unload 'isdn4linux' Module" $SYSPATH/rmmod isdn # unload VJ-compression module echo "Unload 'VJ-Compression' Module" $SYSPATH/rmmod slhc # All done, clear flag rm -f /var/lock/subsys/isdn-hw echo "Done!" ;; *) echo "Syntax: isdn-hw.init {start|stop}" exit 1 esac #set +x exit 0