#!/bin/sh # rc.isdn This shell script boots up the ISDN subsystem. # Comments to Jeroen van Pelt # Little bug fixed by Dennis Vink ;) case "$1" in start) if [ ! -r /etc/i4l.conf ] then echo "cannot read /etc/i4l.conf" else . /etc/i4l.conf echo "Starting isdn4linux" # Loading Modules $MODPROBE hisax type=$TYPE \ protocol=$PROTOCOL \ io=$ISDN_IO \ irq=$ISDN_IRQ $HISAXCTRL HiSax 1 0x3ff # Global $ISDNCTRL verbose 2 # Check if we should start isdnlog if [ $STARTLOG = "YES" ] then $ISDNLOG -sS -v1 -w10 -m0x17d7 -l0x3d7 \ -C /dev/console \ -D /dev/isdnctrl fi # ISDN device drivers ippp0 (syncPPP) $ISDNCTRL addif $IF0 $ISDNCTRL addphone $IF0 out $PROV1_MSN $ISDNCTRL eaz $IF0 $MY_MSN $ISDNCTRL huptimeout $IF0 $HUPTO $ISDNCTRL secure $IF0 $SECURE $ISDNCTRL l2_prot $IF0 $L2_PROT $ISDNCTRL l3_prot $IF0 $L3_PROT $ISDNCTRL encap $IF0 $ENCAP $ISDNCTRL pppbind $IF0 $BINDNAME # This line is necessary for the newest HiSax versions # Add this line by hand if you want to upgrade your scripts # from previous versions. Don't forget to add $DIALMODE to # /etc/i4l.conf $ISDNCTRL dialmode $IF0 $DIALMODE $IFCONFIG $IF0 $MY_IP pointopoint $PROV1_IP metric 1 $IFCONFIG $IF0 -arp -broadcast # Starting ipppd and checking for static IP if [ $DYN_IP = "YES" ] then $IPPPD remotename $REMNAME \ user $NAME \ ipcp-accept-local \ ipcp-accept-remote \ /dev/ippp0 & else REMNAME="demon" NAME="supermad" $IPPPD remotename $REMNAME \ user $NAME \ $MY_IP:$PROV1_IP \ /dev/ippp0 & fi fi ;; stop) echo "Shutting down isdn4linux..." if [ ! -r /etc/i4l.conf ] then echo "Cannot read /etc/i4l.conf" else . /etc/i4l.conf $IFCONFIG $IF0 down sleep 1 $ISDNCTRL delif $IF0 sleep 1 killall ipppd # Check if isdnlog was started and then kill it if [ $STARTLOG = "YES" ] then echo "Killing isdnlog" killall isdnlog fi fi ;; *) echo "Usage: $0 {start|stop}" exit 1 ;; esac